How to use the mongodb-extended-json.serialize function in mongodb-extended-json

To help you get started, we’ve selected a few mongodb-extended-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hemerajs / hemera / packages / hemera-mongo-store / index.js View on Github external
const preResponseHandler = result => {
    if (opts.serializeResult === true) {
      return serialize(result)
    }
    return result
  }
github vkarpov15 / dookie / index.js View on Github external
collection = yield collections.next()) {
      let namespace = ns(`test.${collection.name}`);
      if (namespace.system || namespace.oplog || namespace.special) {
        continue;
      }
      if (!first) {
        stream.write(',\n');
        first = false;
      }
      stream.write(`"${collection.name}": [\n`);

      const cursor = db.collection(collection.name).find();
      for (let doc = yield cursor.next();
          doc != null;
          doc = yield cursor.next()) {
        stream.write(JSON.stringify(ejson.serialize(doc), null, '  '));
      }

      stream.write(`\n]`);
    }
    stream.write(`\n}`);
  });
}
github vkarpov15 / dookie / index.js View on Github external
      res[collection] = contents[i].map(doc => ejson.serialize(doc));
    });