Skip to content
Advertisement

Tag: bson

How to add to an existing MongoDB Bson Filter in Java

I’m using MongoDB 3.6.3 and the 3.6.0 Mongo & Bson drivers for Java. Given the following filter: I need to conditionally add another field to filter, effectively making it: Is there a way to do this by appending that field to filter, or do I have to create the filters separately? eg. Answer Filters.and() returns an instance of the private

Advertisement