Mongo delete document with _id

Yes, we really have to improve this! In the meantime you can fine a workaround mentioned here:

So it would be with a fixed ID:

{ "$expr": { "$eq": ["$_id", { "$toObjectId": "your-id" }] } }

or with expression:

{ "$expr": { "$eq": ["$_id", { "$toObjectId": "{{$json["_id"]}}" }] } }
3 Likes