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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -