mongo.bson.iterator.value(rmongodb)
mongo.bson.iterator.value()所属R语言包:rmongodb
Return the value of the field pointed to by an iterator
返回字段的值指向一个迭代器
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Return the value of the field pointed to by a mongo.bson.iterator.
返回字段的值指向一个mongo.bson.iterator。
用法----------Usage----------
mongo.bson.iterator.value(iter)
参数----------Arguments----------
参数:iter
A mongo.bson.iterator.
一个mongo.bson.iterator。
值----------Value----------
The value of the field pointed to by iter.
字段的值所指向的iter。
This function returns an appropriate R object depending on the type of the field pointed to by the iterator. This mapping to values is as follows:
此函数返回一个适当的R对象根据指出的迭代器类型的字段。此值的映射如下:
Special handling:
特别处理:
mongo.bson.object: If the object is recognized as a complex value (of the form { "r" : double, "i" : double }), a complex value is returned. If the special wrapper as output by<br> mongo.bson.buffer.append.object() is detected, an appropriately attributed R object is returned; otherwise, a list is returned containing the subfields.
mongo.bson.object:如果对象被确认为一个复杂的值({“R”:双“I”:双})的形式,一个复杂的返回值。如果输出的特殊包装的参考mongo.bson.buffer.append.object()被检测到,适当的责任归属的R对象,则返回,否则返回一个数组包含的子域。
mongo.bson.array: If all fields of the array are of the same atomic type, a vector of that type is returned. (Multidimensinal arrays are detected and the dims attribute will be set accordingly. Arrays of complex values are also detected as above). Otherwise, a list is returned containing the subfields.
mongo.bson.array:如果是相同的原子类型的阵列中的所有字段,该类型的向量被返回。 (Multidimensinal阵列检测和dims属性进行相应的设置。复值的数组也发现如上)。否则,一个列表返回包含子场。
mongo.bson.binary: If non-zero, the subtype of the binary data is stored in the attribute "subtype". See mongo.bson.buffer.append.raw().
mongo.bson.binary:如果不为零,该子类型的二进制数据被存储在“子类型”的属性。见mongo.bson.buffer.append.raw()。
参见----------See Also----------
mongo.bson.iterator,<br> mongo.bson.iterator.create,<br> mongo.bson.find,<br> mongo.bson.iterator.next,<br> mongo.bson.iterator.key,<br> mongo.bson.iterator.type,<br> mongo.bson.
mongo.bson.iterator,<BR>mongo.bson.iterator.create,参考mongo.bson.find,参考mongo.bson.iterator.next,参考mongo.bson.iterator.key,参考mongo.bson.iterator.type :参考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)
# 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:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|