0

I have a collection named example_Collection with data of format:

{
{
 "_id": ObjectId("100"),
 "source_timestamp":{
   "sec" : 90000
  }
 }
 {
 "_id": ObjectId("200"),
 "source_timestamp":{
   "sec" : 95000
  }
  {
 "_id": ObjectId("300"),
 "source_timestamp":{
   "sec" : 100000
  }
 }
 }

}

I need to find the documents which has sec from greater then 9000 and small than 10000.

For this mongoquery is working: db.example_Collection.find({"source.timestamp.sec":{$gte:9000,$lt:10000}})

but how to write the same query in mongo C driver?

Kavita Jain
  • 90
  • 1
  • 9
  • Have you tried the [tutorial](http://mongoc.org/libmongoc/current/tutorial.html#tutorial)? – Joe Aug 26 '21 at 10:42
  • Yes I have tried, but there it was very basic query, but in ,my case its nested json and with greater than and less than comparison. – Kavita Jain Aug 26 '21 at 10:45

0 Answers0