public K getSavedId ( ) { if ( dbObjects . length == 0 ) { throw new MongoException ( "No objects to return" ) ; } if ( dbObjects [ 0 ] instanceof JacksonDBObject ) { throw new UnsupportedOperationException ( "Generated _id retrieval not supported when using stream serialization" ) ; } return jacksonDBCollection . convertFromDbId ( dbObjects [ 0 ] . get ( "_id" ) ) ; }
Get the saved ID . This may be useful for finding out the ID that was generated by MongoDB if no ID was supplied .