static ChangeEvent < BsonDocument > changeEventForLocalInsert ( final MongoNamespace namespace , final BsonDocument document , final boolean writePending ) { final BsonValue docId = BsonUtils . getDocumentId ( document ) ; return new ChangeEvent <> ( new BsonDocument ( ) , OperationType . INSERT , document , namespace , new BsonDocument ( "_id" , docId ) , null , writePending ) ; }
Generates a change event for a local insert of the given document in the given namespace .