void upsert(MongoCollection<Document> collection,Bson filter,Bson update) {
collection.updateOne(filter,new Document("$set",update),new UpdateOptions().upsert(true));
}
详见[http://stackoverflow.com/questions/17319307/how-to-upsert-with-mongodb-java-driver]