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
Post a Comment