Category Archives: BSON

MongoException multi update only works with $ operators

It is quite possible for the first MongoDB Official Logotime when you are working with Multiple documents update in MongoDB you might see this exception.
Exception in thread “main” com.mongodb.MongoException: multi update only works with $ operators Continue reading MongoException multi update only works with $ operators

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Update Multiple Documents MongoDB Java Example

This post will talk about Update Multiple Documents MongoDB Java Example.
In the last few examples MongoDB Official Logowe have seen that, we are using the default version of update() method , where it takes 2 arguments i.e. search criteria object and modified object. Whenever this version of update() method is executed it updates only Continue reading Update Multiple Documents MongoDB Java Example

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Can’t serialize class – MongoDB Illegal Argument Exception

While working on the array modifiers example MongoDb
, I was trying to use the $sort
modifier with $each and $push modifier
.In that example I added
an array of books to my original
document and was trying to sort it on the basis of one of the fields.As soon as I executed that method,i got our infamous IllegalArgumentException : Exception in thread “main” java.lang.IllegalArgumentException: can’t serialize class com.lotusmedia.mongo.models.Book (Can’t serialize class – MongoDB). Continue reading Can’t serialize class – MongoDB Illegal Argument Exception

Binary JSON (BSON)

To understand BSON we have to go back to JSON to understand why it was designed and that is to provide a light weight medium for transferring the data over the wire that can be serialized and deserialized very fast. BSON took this thing one step ahead.

Binary JSON or BSON is the binary version of JSON i.e javascript object notation.In simple terms we can also say that it is an extension over the conventional JSON.It supports all the features that are available in JSON that means anything that can be represented or processed in JSON can be done in BSON also,in addition to that BSON also provides some extra advantage over JSON.
BSON Specs can be seen here. Continue reading Binary JSON (BSON)

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS