I am trying to modify object using mlab api through ajax call.Following is the code used:
query="{'email':'"+localStorage.getItem("email") +"','restore':'yes'}"
object={"$set":{'restore':"no"}}
$.ajax({
url: "https://api.mongolab.com/api/1/databases/db/collections/coll?apiKey=apiKey&q="+query,
data: JSON.stringify( object ),
type: "PUT",
contentType: "application/json"
}).done(function( restored_obj ) {
console.log(restored_obj)
})
The object gets successfully updated.The response that I receive is only the number of objects that are modified and not the modified object itself. How do I get modified objects without making a round trip?