How to use the mongodb-data-service function in mongodb-data-service

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

github mongodb-js / compass-aggregations / electron / renderer / index.js View on Github external
const exportToLangStore = configureExportToLangStore({
  localAppRegistry: localAppRegistry
});

const createViewStore = configureCreateViewStore({
  localAppRegistry: localAppRegistry,
  globalAppRegistry: appRegistry
});

const connection = new Connection({
  hostname: '127.0.0.1',
  port: 27017,
  ns: 'admin'
});
const dataService = new DataService(connection);

dataService.connect((error, ds) => {
  appRegistry.emit('data-service-connected', error, ds);
  setDataProvider(store, error, ds);
  setDataProvider(createViewStore, error, ds);
  setNamespace(store, 'citibike.trips');
  // setViewSource(store, 'citibike.tripsOfShortDuration', [{ $match: { gender: 1 }}]);
});

// Create a HMR enabled render function
const render = Component => {
  ReactDOM.render(
    <AppContainer>
      <div>
        <Component store={store} />
        <CreateViewPlugin store={createViewStore} />

mongodb-data-service

MongoDB Data Service

SSPL
Latest version published 14 days ago

Package Health Score

78 / 100
Full package analysis

Popular mongodb-data-service functions