String to BSON conversion using MongoDB java driver -


i performing collection.find() operation using mongo-java-driver 3.4 , taking input end user string variable.

the string variable try replicate bson query.

string qur = " or(eq(\"columname1\", \"value1\"),eq(\"columname2\",\"value2\"))";

however find operation takes bson argument shown below

bson query= or(eq("columname1", "value1"),eq("columname2","value2"));

facing challenge while converting string input bson format. there solution convert same or there other input can provide perform find() operation ?

any kind of appreciated. in advance.


Comments

Popular posts from this blog

The SDK directory does not exist (ubuntu 16.04) (react native) -

python - How to clone or copy a list? -

Convert excel to pdf with VBScript -