java - How to insert a single field into a JSON using MongoTemplate? -


so, making program, trying learn more spring , mongodb. have built ticked module, uses mongodb store ticket info in json format. looks this:

>  {  >      "_id" : objectid("581fb1a24beb291d27f95a50"),       >      "userid" : "581ddccb4beb29112a7b4f77",  >      "ticketstatus" : "processing",  >      "ticketsolution" : "not_solved", >      "ticketcomment" : null;  >   } 

my question how insert comment "ticketcomment" field? (i need uses criteria.where("ticketid").is(ticketid))

with simplest details use :-

criteria.where("ticketid").is(ticketid)); query query = new query(criteria); basicdbobject newvalues = new basicdbobject(columnname,value); basicdbobject set = new basicdbobject("$set", newvalues); update update = new basicupdate(set); mongooperations.updatemulti(query, update, "collectionname") 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -