mirror of https://gitee.com/bigwinds/arangodb
Updated VPack addObject to openObject
This commit is contained in:
parent
7f8d6bc09a
commit
757577de42
|
@ -45,7 +45,7 @@ using JsonHelper = triagens::basics::JsonHelper;
|
|||
|
||||
VPackBuilder ExecutionStats::toVelocyPack () const {
|
||||
VPackBuilder result;
|
||||
result.addObject();
|
||||
result.openObject();
|
||||
result.add("writesExecuted", VPackValue(writesExecuted));
|
||||
result.add("writesIgnored", VPackValue(writesIgnored));
|
||||
result.add("scannedFull", VPackValue(scannedFull));
|
||||
|
@ -63,7 +63,7 @@ VPackBuilder ExecutionStats::toVelocyPack () const {
|
|||
|
||||
VPackBuilder ExecutionStats::toVelocyPackStatic () {
|
||||
VPackBuilder result;
|
||||
result.addObject();
|
||||
result.openObject();
|
||||
result.add("writesExecuted", VPackValue(0));
|
||||
result.add("writesIgnored", VPackValue(0));
|
||||
result.add("scannedFull", VPackValue(0));
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace triagens {
|
|||
|
||||
VPackBuilder toVelocyPack () const {
|
||||
VPackBuilder result;
|
||||
result.addObject();
|
||||
result.openObject();
|
||||
result.add("rulesExecuted", VPackValue(rulesExecuted));
|
||||
result.add("rulesSkipped", VPackValue(rulesSkipped));
|
||||
result.add("plansCreated", VPackValue(plansCreated));
|
||||
|
|
|
@ -150,7 +150,7 @@ void Profile::setDone (ExecutionState state) {
|
|||
|
||||
VPackBuilder Profile::toVelocyPack () {
|
||||
VPackBuilder result;
|
||||
result.addObject();
|
||||
result.openObject();
|
||||
for (auto const& it : results) {
|
||||
result.add(StateNames[static_cast<int>(it.first)], VPackValue(it.second));
|
||||
}
|
||||
|
|
|
@ -400,7 +400,7 @@ std::string Index::context () const {
|
|||
|
||||
std::shared_ptr<VPackBuilder> Index::toVelocyPack (bool withFigures, bool closeToplevel) const {
|
||||
std::shared_ptr<VPackBuilder> builder(new VPackBuilder());
|
||||
builder->addObject();
|
||||
builder->openObject();
|
||||
builder->add("id", VPackValue(std::to_string(_iid)));
|
||||
builder->add("type", VPackValue(typeName()));
|
||||
|
||||
|
@ -436,7 +436,7 @@ std::shared_ptr<VPackBuilder> Index::toVelocyPack (bool withFigures, bool closeT
|
|||
|
||||
std::shared_ptr<VPackBuilder> Index::toVelocyPackFigures (bool closeToplevel) const {
|
||||
std::shared_ptr<VPackBuilder> builder(new VPackBuilder());
|
||||
builder->addObject();
|
||||
builder->openObject();
|
||||
builder->add("memory", VPackValue(memory()));
|
||||
if (closeToplevel) {
|
||||
builder->close();
|
||||
|
|
|
@ -282,7 +282,7 @@ bool RestCursorHandler::wasCanceled () {
|
|||
|
||||
VPackBuilder RestCursorHandler::buildOptions (VPackSlice const& slice) const {
|
||||
VPackBuilder options;
|
||||
options.addObject();
|
||||
options.openObject();
|
||||
|
||||
VPackSlice count = slice.get("count");
|
||||
if (count.isBool()) {
|
||||
|
|
|
@ -109,7 +109,7 @@ HttpHandler::status_t RestExportHandler::execute () {
|
|||
|
||||
VPackBuilder RestExportHandler::buildOptions (VPackSlice const& slice) {
|
||||
VPackBuilder options;
|
||||
options.addObject();
|
||||
options.openObject();
|
||||
|
||||
VPackSlice count = slice.get("count");
|
||||
if (count.isBool()) {
|
||||
|
@ -396,7 +396,7 @@ void RestExportHandler::createCursor () {
|
|||
}
|
||||
else {
|
||||
// create an empty options object
|
||||
optionsBuilder.addObject();
|
||||
optionsBuilder.openObject();
|
||||
}
|
||||
|
||||
VPackSlice options = optionsBuilder.slice();
|
||||
|
@ -540,7 +540,7 @@ void RestExportHandler::deleteCursor () {
|
|||
_response = createResponse(HttpResponse::ACCEPTED);
|
||||
_response->setContentType("application/json; charset=utf-8");
|
||||
VPackBuilder result;
|
||||
result.addObject();
|
||||
result.openObject();
|
||||
result.add("id", VPackValue(id));
|
||||
result.add("error", VPackValue(false));
|
||||
result.add("code", VPackValue(_response->responseCode()));
|
||||
|
|
|
@ -1529,7 +1529,7 @@ std::shared_ptr<VPackBuilder> RestImportHandler::createVelocyPackObject (VPackSl
|
|||
|
||||
try {
|
||||
std::shared_ptr<VPackBuilder> result(new VPackBuilder());
|
||||
result->addObject();
|
||||
result->openObject();
|
||||
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
VPackSlice const key = keys.at(i);
|
||||
|
|
|
@ -304,7 +304,7 @@ void RestSimpleHandler::removeByKeys (VPackSlice const& slice) {
|
|||
}
|
||||
|
||||
VPackBuilder bindVars;
|
||||
bindVars.addObject();
|
||||
bindVars.openObject();
|
||||
bindVars.add("@collection", VPackValue(collectionName));
|
||||
bindVars.add("keys", keys);
|
||||
bindVars.close();
|
||||
|
|
|
@ -200,7 +200,7 @@ void RestSimpleQueryHandler::allDocuments () {
|
|||
}
|
||||
|
||||
VPackBuilder bindVars;
|
||||
bindVars.addObject();
|
||||
bindVars.openObject();
|
||||
bindVars.add("@collection", VPackValue(collectionName));
|
||||
|
||||
std::string aql("FOR doc IN @@collection ");
|
||||
|
@ -228,7 +228,7 @@ void RestSimpleQueryHandler::allDocuments () {
|
|||
aql.append("RETURN doc");
|
||||
|
||||
VPackBuilder data;
|
||||
data.addObject();
|
||||
data.openObject();
|
||||
data.add("query", VPackValue(aql));
|
||||
data.add("bindVars", bindVars.slice());
|
||||
data.add("count", VPackValue(true));
|
||||
|
|
Loading…
Reference in New Issue