mongo.cursor.destroy(rmongodb)
mongo.cursor.destroy()所属R语言包:rmongodb
Release resources attached to a cursor
释放资源连接到一个游标
译者:生物统计家园网 机器人LoveR
描述----------Description----------
mongo.cursor.destroy(cursor) is used to release resources attached to a cursor on both the client and server.
mongo.cursor.destroy(cursor)是用来释放连接的客户端和服务器上的光标资源。
Note that mongo.cursor.destroy(cursor) may be called before all records of a result set are iterated through (for example, if a desired record is located in the result set).
请注意,mongo.cursor.destroy(cursor)可能被调用之前被遍历的结果集的所有记录(例如,如果所希望的记录结果集位于)。
Although the 'destroy' functions in this package are called automatically by garbage collection, this one in particular should be called as soon as feasible when finished with the cursor so that server resources are freed.
虽然“破坏”功能会自动调用该包中的垃圾回收,这其中尤其应称为可引号况下尽快完成后,用光标,使服务器资源被释放。
用法----------Usage----------
mongo.cursor.destroy(cursor)
参数----------Arguments----------
参数:cursor
(mongo.cursor) A mongo.cursor object returned from mongo.find().
(mongo.cursor),一个mongo.cursor返回的对象从mongo.find()。
值----------Value----------
TRUE if successful; otherwise, FALSE (when an error occurs during sending the Kill Cursor operation to the server). in either case, the cursor should not be used for further operations.
TRUE,如果成功,否则,FALSE(发生错误时,在发送过程中的Kill游标操作的服务器)。在上述任何一种情况下,光标不应该被用于进一步的操作。
参见----------See Also----------
mongo.find,<br> mongo.cursor,<br> mongo.cursor.next,<br> mongo.cursor.value.
mongo.find,<BR> mongo.cursor,参考mongo.cursor.next,参考mongo.cursor.value。
实例----------Examples----------
mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "city", "St. Louis")
query <- mongo.bson.from.buffer(buf)
# Find the first 1000 records in collection people[第1000条记录中收集的人]
# of database test where city == "St. Louis"[数据库的测试,其中城市==“圣路易斯”]
cursor <- mongo.find(mongo, "test.people", query, limit=1000L)
# Step though the matching records and display them[虽然步骤匹配的记录,并显示它们]
while (mongo.cursor.next(cursor))
print(mongo.cursor.destroy(cursor))
mongo.cursor.destroy(cursor)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|