src/main/java/org/mongojack/JacksonMongoCollection.java
/**
     * Performs an update operation, replacing the entire document.
     *
     * @param query
     *            search query for old object to replace
     * @param object
     *            object with which to replace <tt>query</tt>
     * @param upsert
     *            if the database should create the element if it does not exist
     * @param concern
     *            the write concern
     * @return The write result
     * @throws MongoWriteException
     *             If the write failed due some other failure specific to the update command
     * @throws MongoWriteConcernException
     *             If the write failed due being unable to fulfill the write concern
     * @throws MongoException
     *             If an error occurred
     */
Performs an update operation, replacing the entire document.
Performs an update operation replacing the entire document .
public UpdateResult replaceOne(DBQuery.Query query, T object, boolean upsert, WriteConcern concern) throws MongoException, MongoWriteException,
            MongoWriteConcernException {
        if (concern != null) {
            return mongoCollection.withWriteConcern(concern).replaceOne(serializeQuery(query), object, new ReplaceOptions().upsert(
                    upsert));
        } else {
            return mongoCollection.replaceOne(serializeQuery(query), object, new ReplaceOptions().upsert(upsert));
        }
    }
public UpdateResult replaceOne ( DBQuery . Query query , T object , boolean upsert , WriteConcern concern ) throws MongoException , MongoWriteException , MongoWriteConcernException { if ( concern != null ) { return mongoCollection . withWriteConcern ( concern ) . replaceOne ( serializeQuery ( query ) , object , new ReplaceOptions ( ) . upsert ( upsert ) ) ; } else { return mongoCollection . replaceOne ( serializeQuery ( query ) , object , new ReplaceOptions ( ) . upsert ( upsert ) ) ; } }
Performs an update operation, replacing the entire document.
Performs an update operation replacing the entire document .