jina-ai / executors

internal-only
Apache License 2.0
31 stars 12 forks source link

MongoDB: more efficient search #93

Open cristianmtr opened 3 years ago

cristianmtr commented 3 years ago

Also regarding the search, you should not use collection.find_one for performance reasons.

I think it is much more efficient to search all documents at once and then sort them:

.find({'id': { '$in': ids }})