public static Bson pullByFilter ( final Bson filter ) { return new Bson ( ) { @ Override public < TDocument > BsonDocument toBsonDocument ( final Class < TDocument > tDocumentClass , final CodecRegistry codecRegistry ) { BsonDocumentWriter writer = new BsonDocumentWriter ( new BsonDocument ( ) ) ; writer . writeStartDocument ( ) ; writer . writeName ( "$pull" ) ; encodeValue ( writer , filter , codecRegistry ) ; writer . writeEndDocument ( ) ; return writer . getDocument ( ) ; } } ; }
Creates an update that removes from an array all elements that match the given filter .