Socket
Socket
Sign inDemoInstall

mongoose-elastic

Package Overview
Dependencies
112
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongoose-elastic

Do stuff with elastic and mongoose


Version published
Maintainers
1
Created

Readme

Source

Mongoose-elastic

Do stuff with elastic and mongoose

Version

0.3

Tech

  • Mongoose

Directory Structure

|---mongoose-elastic
   |-lib
   |-test

Install

npm install mongoose-elastic --save

Setup

Add a mapping and prefix.

activitySchema.plugin(elastic, { prefix: 'dev',
  mapping: {

    message: String,
    event: {
      title: String
    }
  }
})

syncAll

Sync things.

Activity.syncAll(function(err) {
   if (err) {
     console.log(err);
  }

  console.log('done!');
})

sync

activity.sync(function() {})

Global

elastic.search.config({ prefix: 'stage' });
elastic.search({ collections: ['activities'] }, function(err, results) {
  if (err) {
    console.log(err);
  }

  console.log(results);
})

Just a collection

Activity.search({ prefix: 'dev' }, function(err, results) {
  if (err) {
    console.log(err);
  }

  console.log(results);
})

Tests


make test

FAQs

Last updated on 06 May 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc