Skip to content

Commit 8fddacd

Browse files
committed
Update toString method
1 parent 9696d7d commit 8fddacd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎MongoDB/src/Document.cpp‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,16 @@ void Document::read(BinaryReader& reader)
133133
std::string Document::toString() const
134134
{
135135
std::ostringstream oss;
136+
oss << "{" << std::endl;
136137
for(ElementSet::const_iterator it = _elements.begin(); it != _elements.end(); ++it)
137138
{
138-
oss << (*it)->name() << " ";
139+
if ( it != _elements.begin() )
140+
{
141+
oss << ", ";
142+
}
143+
oss << '"' << (*it)->name() << '"' << " : " << (*it)->toString();
139144
}
145+
oss << "}" << std::endl;
140146
return oss.str();
141147
}
142148

0 commit comments

Comments
 (0)