1.0.13 • Published 6 years ago

@wamongo/web-client v1.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Get Started

Web

<script src="https://storage.googleapis.com/mongo-realtime/cdn/1.0.0/mongo-realtime.js"></script>
<script>
  // Initialize
  // TODO: Replace with your project's customized code snippet
  var config = {
    domain: "localhost:3333",
  };
  mongoRT.initializeApp(config);
</script>

Node JS

Installation

npm install mongo-realtime-client

Usage

var mongoRT = require("mongo-realtime-client");
var config = {
  domain: "localhost:3333",
};
var client = mongoRT.initializeApp(config);

API

Mongo API

findOne

Fetches the first document that matches the query

client.findOne(query [,options]) => Promise
example
client.findOne({spam: false})
  .then((doc) => console.log(doc))

Realtime API