Questions tagged [mongojack]

Mongojack is a library that facilitates mapping between Java objects and MongoDB documents.

Since MongoDB uses BSON, a binary form of JSON, to store its documents, a JSON mapper is a perfect mechanism for mapping Java objects to MongoDB documents. And the best Java JSON mapper is Jackson. Jackson’s parsing/generating interface fits serialising to MongoDBs documents like a glove. Its plugins, custom creators, serialisers, views, pluggable annotators and so on give this mapping library a massive head start, making it powerful, performant, and robust.

Features

  • Deserialises queried objects directly from the MongoDB stream, making it one of the (if not the) fastest object mappers for MongoDB out there.

  • Uses Jackson for object mapping, so compatible with most Jackson features, including custom serialisers and deserialisers, creators, views, annotation introspectors, etc.

  • Wraps the MongoDB driver DBCollection, providing most of the original methods, plus strongly typed versions.

  • Gives low level access to advanced MongoDB driver features.

  • Supports querying using objects as templates, and selecting fields to return using objects as templates.

  • Supports mapping ObjectIds to strings and byte arrays, using an @ObjectID annotation.

  • Supports @javax.persistance.Id annotation for marking which property is the id (or just call it _id).

  • Provides interface to building update commands with update modifiers, which supports POJOs which will be serialised by Jackson.

  • Provides terse chained query builders

  • Supports database reference conventions, with convenience methods for fetching references and collections of references in one query.

Reference :

http://mongojack.org/

33 questions
0
votes
1 answer

Jackson, hashed password not being mapped

I have the following collection "player" { "_id" : ObjectId("5426efb844ae829d1dcdaa6d"), "username" : "Foobar", "password" : "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33", "gameIds" : [ "5426f10544ae8502f731d8a0" ] } It…
Shervin Asgari
  • 23,901
  • 30
  • 103
  • 143
0
votes
1 answer

MongoDB - MongoJack find and remove

I am completely new to MongoDB and MongoJack. I have this collection called pbf { "_id" : ObjectId("541ea72044ae1b4043e9ccba"), "name" : "First civ game", "type" : "WAW", "numOfPlayers" : 4, …
Shervin Asgari
  • 23,901
  • 30
  • 103
  • 143
0
votes
1 answer

Use of MongoJack and updateById

I am having a problem with the usage of MongoJack and updateById method. In the javadoc from MongoJack, it states that the method updateById(K, T) (link to javadoc) can be used with K as the key and T as the object to save. However, the following…
nilsmagnus
  • 2,210
  • 23
  • 33
1 2
3