Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
0.4
-
None
-
Linux 64 bit
Description
Data:
================================================================
PRIMARY> use config
switched to db config
PRIMARY> db.tpgen.find().pretty()
{
"_id" : "outque",
"creation_dt" : ISODate("2011-11-11T12:24:18.197Z"),
"description" : "Name of TPGEN outque",
"value" : "bwh"
}
CODE:
================================================================
bson cmd;
bson out =
;
bson_init( &cmd );
bson_append_string( &cmd, "findAndModify", "tpgen" );
bson_append_start_object( &cmd, "query" );
bson_append_string( &cmd, "_id", key_p );
bson_append_finish_object( &cmd );
bson_append_start_object( &cmd, "update" );
bson_append_start_object( &cmd, "$set" );
bson_append_time_t( &cmd, "last_access_time", time( NULL ) );
bson_append_finish_object( &cmd );
bson_append_finish_object( &cmd );
bson_append_start_object( &cmd, "fields" );
bson_append_string( &cmd, "value", "" );
bson_append_finish_object( &cmd );
bson_finish( &cmd );
if( mongo_run_command( conn, "config", &cmd, &out ) == MONGO_OK )
{
bson_print( &out );
bson_iterator it;
if( bson_find( &it, &out, "value" ) )
}
bson_print( &out) above printouts;
================================================
lastErrorObject : 3
updatedExisting : 8 true
n : 16 1
lastOp : 18 5673711064269717505
connectionId : 16 2645
err : 10 BSON_NULL
ok : 1 1.000000
value : 3
_id : 2 outque
value : 2 bwh
ok : 1 1.000000
Question: I dont understand why an ego object is returned in out bson object.