1.0.1 • Published 7 years ago

mongosockets v1.0.1

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

mongosockets

Install

npm install mongosockets

Usage (server)

npm start 3000

Start new worker on port 9000

npm run worker 9000 mongodb://localhost/test

Usage (client)

import {connect} from 'mongosockets';
import maeva, {Model} from 'maeva';

// Define a model
class User extends Model {
  static schema = {email: String};
}

// Connect to a mongosockets server
await maeva.connect(connect('ws://localhost:9000'));

// Perform queries
await User.insert({email: 'john@doe.com'});