Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including mongodb-infer with all npm packages installed. Try it out:

var mongodbInfer = require("mongodb-infer")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mongodb-infer v0.0.5

MongoDB schema inference


DEPRECATED: Please see mongodb-schema for your schema inference needs.

build status

MongoDB schema inference

var infer = require('mongodb-infer'),

console.log('simple document', infer({
  "_id": "536c02d34efcef0c2f2439b9",
  "service_request_id": 101001366957,
  "status": "closed",
  "status_notes": "Completed - The request has been concluded.",
  "service_name": "Road - Pot hole",
  "service_code": "CSROWR-12",
  "description": null,
  "agency_responsible": "311 Toronto",
  "service_notice": null,
  "requested_datetime": "2012-02-14T20:58:35-04:00",
  "updated_datetime": "2012-02-17T07:56:00-04:00",
  "expected_datetime": "2012-05-14T20:59:00-04:00",
  "address": "46 LAMBTON AVE",
  "address_id": 9544823,
  "zipcode": null,
  "long": -79.48746252100001,
  "lat": 43.683629226,
  "media_url": null

will output

simple document {
  _id: 'string id',
  service_request_id: 'number id',
  status: 'string',
  status_notes: 'string',
  service_name: 'string',
  service_code: 'enum',
  description: 'text',
  agency_responsible: 'string',
  service_notice: 'object',
  requested_datetime: 'date',
  updated_datetime: 'date',
  expected_datetime: 'date',
  address: 'string',
  address_id: 'number id',
  zipcode: 'enum',
  long: 'geo long',
  lat: 'geo lat',
  media_url: 'url'



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free