I have a collection of 290,000 documents with different timestamps, is there a way to specify a list of timestamps (lets say 200) using $in ['1506952790995', '1506953025981' ... ] and to have mongoDB find 200 documents from the full collection which are nearest to the specified timestamps in the list, if exact matches cannot be found (assuming that the full collection may not have documents precisely matching the $in list all the time)?
here is how all my documents in the collection look like: { _id : ObjectId source: String price: Double timestamp: Date }
What is the fastest query to achieve this?
By the way, this question still cannot be considered dupplicate since, it also asks about --a list-- of timestamps, not just a single one.