Answer the question
In order to leave comments, you need to log in
How to count the number of records in mongoDB with a specific value?
Once a day, data is written to the database. Each record has the following field:
" Created: '2021-02-12 15:16:34' " It is
necessary to calculate how many records were received using Python code, for example, in the period from 2021-02-12 (from 18:00) to 2021- 02-13 (until 18:00)
Answer the question
In order to leave comments, you need to log in
db.collection.find({
created_at: {
$gte: ISODate("2021-02-12 18:00:00.000Z"),
$lt: ISODate("2021-02-13 18:00:00.000Z")
}).count()
count
Or get all the necessary records and calculate the length of the array using the language
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question