Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
private DBCollection renameCollection(String oldCollection, String newCollection) {
if (!mongoTemplate.collectionExists(oldCollection))
return null;
if (mongoTemplate.collectionExists(newCollection))
mongoTemplate.dropCollection(newCollection);
DB db = mongoTemplate.getDb();
DBCollection dbCollection = db.getCollection(oldCollection);
return dbCollection.rename(newCollection, true);
}
Similar Posts:
- : AAPT: warn: multiple substitutions specified in non-positional format; did you mean to add the for
- The use of Hibernate / JPA getsingleresult reports an exception noresult xception:No entity found for query
- ‘tensorflow’ has no attribute ‘add’/’neg’/’mul’
- About flitter_ No applicable application records were found. Verify your
- netstat: command not found centos07
- mongodb error(MongoError: E11000 duplicate key error index)
- Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
- mvn -V No goals have been specified for this build. You must specify a valid lifecycle phase……
- Maximum function nesting level of ‘100’ reached, aborting!
- Linux MySQL error: Troubleshooting query to other database