diff options
author | Spencer T Brody <spencer@mongodb.com> | 2014-09-12 15:27:36 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2014-09-14 18:29:05 -0400 |
commit | 93f961084fa9c9969b0a04445d364ea7056d8efc (patch) | |
tree | 8e34c5dba9addad496f867c6aaa7206dacec7e59 /src/mongo/db/write_concern.cpp | |
parent | 2d8603ecc535b0ff980fe537a7fe16c06d687bb6 (diff) | |
download | mongo-93f961084fa9c9969b0a04445d364ea7056d8efc.tar.gz |
SERVER-15195 Implement getHostsWrittenTo in ReplicationCoordinatorImpl
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r-- | src/mongo/db/write_concern.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp index 3aaefead488..90fe69b947b 100644 --- a/src/mongo/db/write_concern.cpp +++ b/src/mongo/db/write_concern.cpp @@ -105,10 +105,15 @@ namespace mongo { if ( wTimedOut ) result->appendBool( "wtimeout", true ); - if ( writtenTo.size() ) - result->append( "writtenTo", writtenTo ); - else + if (writtenTo.size()) { + BSONArrayBuilder hosts(result->subarrayStart("writtenTo")); + for (size_t i = 0; i < writtenTo.size(); ++i) { + hosts.append(writtenTo[i].toString()); + } + } + else { result->appendNull( "writtenTo" ); + } if ( err.empty() ) result->appendNull( "err" ); |