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 -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -