All Projects → Loophole-Labs-Archive → mongomeili

Loophole-Labs-Archive / mongomeili

Licence: MPL-2.0 license
Keep your Mongoose Schemas synced with MeiliSearch

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mongomeili

mongoose-api-generator
Autogenerate a REST API from your Mongoose models
Stars: ✭ 19 (-42.42%)
Mutual labels:  mongoose
node-lms
E-Learning Management System App - Stack: Node.js, Express, MongoDB
Stars: ✭ 44 (+33.33%)
Mutual labels:  mongoose
myplanet
🌕 myPlanet android app reads data from 🌎 for offline use as well as it collect usage data and sends them back to the Planet.
Stars: ✭ 17 (-48.48%)
Mutual labels:  sync
live-band
Play drums and other instruments with the rest of the world
Stars: ✭ 20 (-39.39%)
Mutual labels:  sync
node-simple-jwt
No description or website provided.
Stars: ✭ 19 (-42.42%)
Mutual labels:  mongoose
graphql-api-starter
Starter API graphql with apollo server and some other shit.
Stars: ✭ 12 (-63.64%)
Mutual labels:  mongoose
dhan-gaadi
A complete online bus reservation system (Node, React, Mongo, NextJS, ReactNative)
Stars: ✭ 207 (+527.27%)
Mutual labels:  mongoose
TabSync
A lightweight synchronizer between Android's Tabs and Lists. Available on the View system and Jetpack Compose.
Stars: ✭ 98 (+196.97%)
Mutual labels:  sync
realestate
A simple real estate app build with MEAN( Angular, Node and mongoDb ) and MERN( React, Node and mongoDb )
Stars: ✭ 33 (+0%)
Mutual labels:  mongoose
errgroup
errgroup with goroutine worker limits
Stars: ✭ 143 (+333.33%)
Mutual labels:  sync
Radium
Synced stream and video playback with VOD capabilities utilizing HLS. Developed for movie nights but has many use cases.
Stars: ✭ 172 (+421.21%)
Mutual labels:  sync
spendlogs
SpendLogs - Personal Expense Manager
Stars: ✭ 18 (-45.45%)
Mutual labels:  mongoose
zhenfan
「教学」商城项目:技术栈vuejs, mongodb, express ;内容:购物车,列表,商品展示
Stars: ✭ 34 (+3.03%)
Mutual labels:  mongoose
mindav
A self-hosted file backup server which bridges WebDAV protocol with @minio written in @totoval. Webdav ❤️ Minio
Stars: ✭ 64 (+93.94%)
Mutual labels:  sync
putio-sync
Command-line program to sync a folder between put.io and your computer.
Stars: ✭ 50 (+51.52%)
Mutual labels:  sync
Pyrez
(ON REWRITE) An easy to use (a)sync wrapper for Hi-Rez Studios API (Paladins, Realm Royale, and Smite), written in Python. 🐍
Stars: ✭ 23 (-30.3%)
Mutual labels:  sync
driwwwle
The social network for developers. Discover creative websites and build a community.
Stars: ✭ 109 (+230.3%)
Mutual labels:  mongoose
gae-vue-webapp2-starter
A simple GAE Vue Webapp2 starter project.
Stars: ✭ 17 (-48.48%)
Mutual labels:  sync
graphql-server-typescript
GraphQL + MongoDB express server with JWT authorization (in Typescript!)
Stars: ✭ 48 (+45.45%)
Mutual labels:  mongoose
mern-boilerplate
A Full MERN Stack Boilerplate for Web Apps including a local authentication system. Uses React, Express.js, MongoDB, Redux, Passport.js, Webpack, Testing, and more.
Stars: ✭ 211 (+539.39%)
Mutual labels:  mongoose

MongoMeili License: MPL 2.0

Keep your MongooseJS Schemas synced with MeiliSearch

This plugin will automatically synchronise your Schemas with aa MeiliSearch index every time a new document is added, updated or removed.

You can also index the entire collection if you're just starting to use the plugin.

NodeJS Installation

Install using npm:

npm install mongomeili

Or with yarn:

yarn add mongomeili

Usage

With MongoMeili you can specify which which fields of your schema you'd like to index by adding a meiliIndex = true property to your schema as shown below:

// ES6
import mongoose from 'mongoose';
import mongomeili from 'mongomeili';

// ES5
const mongoose = require('mongoose');
const mongomeili = require('mongomeili');

// Add the '{ meiliIndex: true }' property to index these attributes with MeiliSearch
const MovieSchema = new mongoose.Schema({
  title: { type: String, required: true, meiliIndex: true },
  director: { type: String, required: true, meiliIndex: true },
  year: { type: String, required: true, meiliIndex: true }
});

// Specify your MeiliSearch credentials
MovieSchema.plugin(mongomeili, {
  host: 'https://...'
  apiKey: '...',
  indexName: '...' // Will get created automatically if it doesn't exist already
})

Options

Option name Type Description
host string The MeiliSearch Host
apiKey string The MeiliSearch API Key (often the Master Key)
indexName string The name of the index that will store the data from your schema

Methods

After applying the mongomeili plugin to your mongoose schema you will have access to the following methods:

Model.syncWithMeili(): Promise

Index the whole collection into your MeiliSearch index.

Model.clearMeiliSearchIndex(): Promise

Clears your MeiliSearch Index and sets _meiliIndex = false on the collection

Model.setMeiliIndexSettings(settings: {}): Promise

Set one or more settings of the MeiliSearch index, the full settings list is available here.

Model.meiliSearch({ query: string, params?: {}, populate?: boolean }): Promise

Search your MeiliSearch index for a specific query. You can customize the search parameters and populate information not indexed from the mongoDB collection as well.

You can find the full list of search parameters here.

The response will look like this:

{
  "hits": [
    {
      "_id": "5f86a08c27772b15560ff4af",
      "title": "Fast and Furious",
      "director": "Rob Cohen",
      "year": "2001"
    }
  ],
  "offset": 0,
  "limit": 20,
  "nbHits": 1,
  "exhaustiveNbHits": false,
  "processingTimeMs": 0,
  "query": "furious"
}

Development

After checking out the repo, run npm install --save-dev or yarn install --dev to install dependencies.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Loophole-Labs/mongomeili. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The MongoMeili project is available as open source under the terms of the Mozilla Public License Version 2.0.

Code of Conduct

Everyone interacting in the MongoMeili project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Project Managed By:

Loophole Labs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].