 
            DataNucleus supports persisting/retrieving objects to/from MongoDB datastores (using the datanucleus-mongodb plugin, which utilises the Mongo Java driver). Simply specify your "connectionURL" as follows
datanucleus.ConnectionURL=mongodb:[{server}][/{dbName}] [,{server2}[,server3}]]For example, to connect to a local server, with database called "myMongoDB"
datanucleus.ConnectionURL=mongodb:/myMongoDB
If you just specify the URL as mongodb then you have a local MongoDB datastore called "DataNucleus", otherwise it tries to connect to the datastore {dbName} at {server}. The multiple {server} option allows you to run against MongoDB replica sets. You then create your PMF/EMF as normal and use JDO/JPA as normal.
The jars required to use DataNucleus MongoDB persistence are datanucleus-core, datanucleus-api-jdo/datanucleus-api-jpa, datanucleus-mongodb and mongo-java-driver
There are tutorials available for use of DataNucleus with MongoDB for JDO and for JPA
Things to bear in mind with MongoDB usage :-
When you have a field in a class that is of a persistable type you sometimes want to store it with the owning object. In this case you can use JDO / JPA embedding of the field. DataNucleus offers two ways of performing this embedding
For JDO this would be defined as follows (for JPA just swap @PersistenceCapable for @Entity)
@PersistenceCapable
public class A
{
    @Embedded
    B b;
    ...
}This example uses the default embedding, using a nested document within the owner document, and could look something like this
{ "name" : "A Name" ,
  "id" : 1 ,
  "b" : { "b_name" : "B name" ,
          "b_description" : "the description"}
}The alternative for JDO would be as follows (for JPA just swap @PersistenceCapable for @Entity)
@PersistenceCapable
public class A
{
    @Embedded
    @Extension(vendorName="datanucleus", key="nested", value="false")
    B b;
    ...
}and this will use flat embedding, looking something like this
{ "name" : "A Name" ,
  "id" : 1 ,
  "b_name" : "B name" ,
  "b_description" : "the description"
}When you have a field in a class that is of a Collection type you sometimes want to store it with the owning object. In this case you can use JDO/ JPA embedding of the field. So if we have
@PersistenceCapable
public class A
{
    @Element(embedded="true")
    Collection<b> bs;
    ...
}and would look something like this
{ "name" : "A Name" ,
  "id" : 1 ,
  "bs" :
      [
        { "name" : "B Name 1" ,
          "description" : "desc 1"} ,
        { "name" : "B Name 2" ,
          "description" : "desc 2"} ,
        { "name" : "B Name 3" ,
          "description" : "desc 3"}
      ]
}