Skip to content

Commit a60d9fb

Browse files
committed
pymongo
1 parent f9c47a0 commit a60d9fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎232.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ db指向了数据库mydb,books是这个数据库里面的一个集合(类似
122122

123123
报错!我在去年做的项目中,就是这样做的,并且网上查看很多教程都是这么连接。
124124

125-
但是,经验主义害死人,如果:
125+
所以,读者如果用的是旧版本的pymongo,比如2.8,仍然可以使用上面的连接方法,如果是像我一样,是用的新的(我安装时没有选版本),就得注意这个问题了。
126+
127+
经验主义害死人。必须看看下面有哪些方法可以用:
126128

127129
>>> dir(pymongo)
128130
['ALL', 'ASCENDING', 'CursorType', 'DESCENDING', 'DeleteMany', 'DeleteOne', 'GEO2D', 'GEOHAYSTACK', 'GEOSPHERE', 'HASHED', 'IndexModel', 'InsertOne', 'MAX_SUPPORTED_WIRE_VERSION', 'MIN_SUPPORTED_WIRE_VERSION', 'MongoClient', 'MongoReplicaSetClient', 'OFF', 'ReadPreference', 'ReplaceOne', 'ReturnDocument', 'SLOW_ONLY', 'TEXT', 'UpdateMany', 'UpdateOne', 'WriteConcern', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '_cmessage', 'auth', 'bulk', 'client_options', 'collection', 'command_cursor', 'common', 'cursor', 'cursor_manager', 'database', 'errors', 'get_version_string', 'has_c', 'helpers', 'ismaster', 'message', 'mongo_client', 'mongo_replica_set_client', 'monitor', 'monotonic', 'network', 'operations', 'periodic_executor', 'pool', 'read_preferences', 'response', 'results', 'server', 'server_description', 'server_selectors', 'server_type', 'settings', 'son_manipulator', 'ssl_context', 'ssl_support', 'thread_util', 'topology', 'topology_description', 'uri_parser', 'version', 'version_tuple', 'write_concern']

0 commit comments

Comments
 (0)