【发布时间】:2015-03-16 19:14:19
【问题描述】:
有人可以为我突出显示 MongoDB DB Java api 中记录的 getCollection(String name) 和 getCollectionFromString(String collectionName) 之间的区别吗?
public DBCollection getCollectionFromString(String collectionName)
Returns a collection matching a given string.
Parameters: collectionName - the name of the collection
Returns: the collection
和
public DBCollection getCollection(String name)
Gets a collection with a given name.
Parameters: name - the name of the collection to return
Returns: the collection
带有示例的插图将是最有帮助的。 (来自https://api.mongodb.org/java/3.0/)
【问题讨论】: