skip to Main Content

Mongodb – I need to do a mongo lookup on data, but want an empty array where no data is found

I am new to mongo and I've got a query that I am running as seen below: db.getCollection('equityprice_input').aggregate([ {'$match': {'mrsBusinessDate': '2022-05-05', 'instrument': 'other', 'sourceSystem': 'bloomberg', 'mrsTime': '17:00:00', 'dataType': 'price'}}, {'$lookup': {'from': 'equityprice_input', 'localField': 'data.securities', 'foreignField': 'data.securities', 'as': 'staticData'}}, {'$project': {'_id':…

VIEW QUESTION
Back To Top
Search