Mongo Search Snippets in Make

PHOTO EMBED

Tue Aug 01 2023 01:08:39 GMT+0000 (Coordinated Universal Time)

Saved by @JasonB

{"_id" : "ObjectId(6465b9f26ada31fa533fc8d0)"}

/* By Date Rate */

{ 
	"$or": [
  	{ "createdAt": { "$gt": "{{addMinutes(now; -19)}}" } },
    { "updatedAt": { "$gt": "{{addMinutes(now; -19)}}" } }
	]
  }

/* By ObjectID Date */

db.collection.find({
  $expr: { 
     $gte: [ {$toDate: "$_id"}, ISODate("2021-01-01T00:00:00Z") ] }
  }
)

/* By ObjectID Date and Role */

{ 
	"$or": [
  	{ "createdAt": { "$gt": "{{addMinutes(now; -11)}}" } },
    { "updatedAt": { "$gt": "{{addMinutes(now; -11)}}" } },
 { "lastSignInTime": { "$gt": "{{addMinutes(now; -11)}}" } }
	],
	"roles": { "$in": ["worker", "jobProvider" ]}
  }
content_copyCOPY