0

I'm pretty new to Mongo, I'm wondering if this is possible:

  1. I have a collection of over 1 million documents, with timestamps from 2014 to 2017.
  2. Each timestamp contains both date as well as the time
  3. I want to see the documents that are sharing some attributes (for example brand: "Apple", cpu: "i5") and have timestamps within 10 minutes of each other, across my whole dataset - in groups

So I imagine it to work like:

  1. Take first document matching the brand: "Apple", cpu: "i5"
  2. Look for documents with timestamp within 10 minute of that document's
  3. Return an array of those documents.
  4. Take next document that matches the query (but one that wasn't included in the previous group) - repeat
  5. Return a list of lists of documents grouped in this manner

Is this something that MongoDB has out of the box, or something I would need to code manually?

LucasSeveryn
  • 5,984
  • 8
  • 38
  • 65

0 Answers0