0

Lots of solutions to querying mongoDB using date/time field in MongoDB but what if the mongo doc doesn't have a date/time field?

I've noticed that when I hover the mouse over a document _id (using NoSQLBooster for MongoDB) I get a "createdAt" dropdown (see screenshot below). Just wondering if there is anyway to do a query using pymongo where documents are filtered based on a date/time range using their "createdAt" metadata?

screen shot of createdAt metadata

1 Answer 1

1

In MongoDB the id of the docs contains the timestamp of creation, this is mentioned on this other question. You can make a script that insert a date/field using this information to perform those queries or perform the query directly to using the objectId as in here.

Sign up to request clarification or add additional context in comments.

1 Comment

Legend! thanks! the answer contained in your last link here was what I was after. It's written in Java but I should be able to adjust it to python with no worries. I'll let you know how I go! thanks again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.