There is no way to generate a random object id in a query without a shell helper (e.g. if you want to write your query as JSON). We should have some aggregation operator, e.g. something like $oid, to randomly generate an object id.
Relevant for working around an issue like SERVER-106347.
- is depended on by
 - 
                    
COMPASS-9597 Investigate changes in SERVER-106452: Operator to generate random object ids
-         
 - Backlog
 
 -         
 
- is related to
 - 
                    
SERVER-106347 $graphLookup should be able to operate on documents without _id field
-         
 - Backlog
 
 -         
 
- related to
 - 
                    
SERVER-108598 Upgrade fcv from 8.2 to 8.3 in JS tests of closed tickets
-         
 - Closed
 
 -         
 - 
                    
SERVER-107710 Support $createObjectId in SBE
-         
 - Needs Scheduling
 
 -