mongo.bson.iterator.next(rmongodb)
mongo.bson.iterator.next()所属R语言包:rmongodb
Advance an iterator to the first or next field
推进一个迭代器的第一个或下一个字段
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Advance a mongo.bson.iterator to the first or next field.
前进一mongo.bson.iterator的第一个或下一个字段。
用法----------Usage----------
mongo.bson.iterator.next(iter)
参数----------Arguments----------
参数:iter
A mongo.bson.iterator.
一个mongo.bson.iterator。
值----------Value----------
(integer) The type of the next of the field pointed to by the iterator as indicated by the folllowing constants:
(整数)的类型的字段的下一个迭代器所指向指示由在以下常数:
mongo.bson.eoo – End of Object (0L)
mongo.bson.eoo - 完对象(0L)
mongo.bson.double
mongo.bson.double
mongo.bson.string
mongo.bson.string
mongo.bson.object
mongo.bson.object
mongo.bson.array
mongo.bson.array
mongo.bson.binary
mongo.bson.binary
mongo.bson.undefined
mongo.bson.undefined
mongo.bson.oid
mongo.bson.oid
mongo.bson.bool
mongo.bson.bool
mongo.bson.date
mongo.bson.date
mongo.bson.null
mongo.bson.null
mongo.bson.regex
mongo.bson.regex
mongo.bson.dbref – deprecated (follow link for more info)
mongo.bson.dbref - 过时(后续链接的详细信息)
mongo.bson.code
mongo.bson.code
mongo.bson.symbol
mongo.bson.symbol
mongo.bson.code.w.scope
mongo.bson.code.w.scope
mongo.bson.int
mongo.bson.timestamp
mongo.bson.timestamp
mongo.bson.long
mongo.bson.long
参见----------See Also----------
mongo.bson.iterator,<br> mongo.bson.iterator.create,<br> mongo.bson.find,<br> mongo.bson.iterator.key,<br> mongo.bson.iterator.type,<br> mongo.bson.iterator.value,<br> mongo.bson.
mongo.bson.iterator,<BR>mongo.bson.iterator.create,参考mongo.bson.find,参考mongo.bson.iterator.key,参考mongo.bson.iterator.type,参考mongo.bson.iterator.value :参考mongo.bson。
实例----------Examples----------
buf <- mongo.bson.buffer.create()
# Append a string[追加一个字符串]
mongo.bson.buffer.append(buf, "name", "Joe")
# Append a date/time[附加一个日期/时间]
mongo.bson.buffer.append(buf, "created", Sys.time())
# Append a NULL[附加一个NULL]
mongo.bson.buffer.append(buf, "cars", NULL)
b <- mongo.bson.from.buffer(buf)
iter <- mongo.bson.iterator.create(b)
# Advance to the "cars" field[推进“汽车”]
while (mongo.bson.iterator.next(iter) != mongo.bson.null)
{
# NOP[NOP]
}
print(mongo.bson.iterator.value(iter))
# The above is given for illustrative purposes, but may be performed [以上是为了说明的目的给出的,但也可以进行]
# much easier by the following:[更容易由下列:]
iter <- mongo.bson.find(b, "cars")
print(mongo.bson.iterator.value(iter))
# iterate through all values and print them with their keys (names)[遍历所有值和打印他们自己的钥匙(名称)]
iter <- mongo.bson.iterator.create(b)
while (mongo.bson.iterator.next(iter)) { # eoo at end stops loop[EOO结束时停止循环]
print(mongo.bson.iterator.key(iter))
print(mongo.bson.iterator.value(iter))
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|