更改BSON字段值(C ++) [英] Change BSON field value (C++)

查看:167
本文介绍了更改BSON字段值(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试BSON作为有线协议,我需要能够更改已经创建的BSONObj的某些值...问题是除了从以下位置重新创建BSONObj之外,我找不到其他方法

I'm testing BSON as a wire protocol, and I need to be able to change some values on a already created BSONObj... the problem is I can't find a way to do this other than recreating the BSONObj from scratch!

有什么提示吗?

推荐答案

我收到了来自德怀特·梅里曼(Dwight Merriman),来自10gen:

I received a reply from Dwight Merriman, from 10gen:


通常它们是不可变的-
的常用用法是对
进行序列化/反序列化从您选择的cpp
对象中选择。另请参阅$ set
和$ inc,但它们是服务器端的。

generaly they are immutable -- the common usage is to serialize/deserialize from a cpp object of your choice. See also $set and $inc but those are server-side.

所以...我们有它: )

So... there we have it :)

这篇关于更改BSON字段值(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆