Custom Query with ObjectId

Hi everyone,

I have struggled with custom query. Here is my query

{ "page": ObjectId("5f61d69d062e9f025786f8fa") }

I want to archive all documents that page is equal to ObjectId(“5f61d69d062e9f025786f8fa”). But system does not allow to do so. It gives error about objectid. How can I archive documents?

I just figured it out. Right query should be like this.

{ "page":  { "$oid": "5f61d69d062e9f025786f8fa" }}

Best

2 Likes