[SERVER-6219] use ::mongo in macros Created: 27/Jun/12  Updated: 11/Jul/16  Resolved: 13/Sep/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Improvement Priority: Major - P3
Reporter: David Schneider Assignee: Phillip Quiza
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

If there is a cascaded mongo namespace in your project BSON and BSON_ARRAY macros won't work any more.

namespace foo { namespace mongo {
 
void bar()
{
  ::mongo::BSONObj bo = BSON("id" << 1);
}
 
} }

The macro should use ::mongo instead

#define BSON(x) (( ::mongo::BSONObjBuilder(64) << x ).obj())
#define BSON_ARRAY(x) (( ::mongo::BSONArrayBuilder() << x ).arr())



 Comments   
Comment by auto [ 13/Sep/13 ]

Author:

{u'username': u'pilliq', u'name': u'Phillip Quiza', u'email': u'pilliq@mongodb.com'}

Message: SERVER-6219: Use ::mongo in macros

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/eb22c8e590a60dde9adde997f34cddcea9d166f8

Generated at Thu Feb 08 03:11:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.