pipeline = [{"$match": {"$and": [{"_id": {"$regex": '^' + nameAndNumber}},
{"times.milliseconds": {"$gte": millisecondsStartRange}},
{"times.milliseconds": {"$lte": millisecondsEndRange}}]}}]fdm_data = list(db.parameters.aggregate(pipeline))db.parameters.find({"$and": [{"_id": {"$regex": '^' + nameAndNumber}}, {"times.milliseconds": {"$gte": millisecondsStartRange}}, {"times.milliseconds": {"$lte": millisecondsEndRange}}]});fdm_data = list(db.parameters.find({"$and": [{"_id": {"$regex": '^' + nameAndNumber}},#REPLACE# {"times.milliseconds": {"$gte": millisecondsStartRange,{"[AFTER SECOND COLON IN _ID]": {"$gte": millisecondsStartRange,
"$lte": millisecondsEndRange}}]}))
here is the best refactoring I think I can do...
fdm_data = list(db.parameters.find({"_id": {"$gte": nameAndNumber + str(millisecondsStartRange),
"$lte": nameAndNumber + str(millisecondsEndRange)}}))
db.parameters.({"_id": {"$gte": nameAndNumber + str(millisecondsStartRange), "$lte": nameAndNumber + str(millisecondsEndRange)}})).explain()
and
db.parameters.getIndexes()
A sample document or two would be handy.
explain is probably better executed with "executionStats" verbosity
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/fcc32591-d2f4-47d9-aa49-0d80ea89ec22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.