# meili-sync

> Connector to sync mongodb documents into meilisearch

Latest version **0.2.0** (published 2020-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install meili-sync
pnpm add meili-sync
yarn add meili-sync
bun add meili-sync
```

Provides the command `meili-sync`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-07-26 |
| First published | 2020-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 20.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Max Nowack |
| Maintainers | maxnowack |
| Keywords | mongodb, meilisearch, sync, data |

## Links

- npm: https://www.npmjs.com/package/meili-sync
- npm.io page: https://npm.io/package/meili-sync

## Dependencies (8)

- [p-map](https://npm.io/package/p-map.md) ^4.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.0
- [mongodb](https://npm.io/package/mongodb.md) ^3.5.9
- [p-retry](https://npm.io/package/p-retry.md) ^4.2.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.1
- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2
- [meilisearch](https://npm.io/package/meilisearch.md) ^0.11.3
- [@types/lodash.get](https://npm.io/package/@types/lodash.get.md) ^4.4.6

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2020-07-26
- 0.1.0 — 2020-07-26

## README

# meili-sync
Connector to sync mongodb documents into meilisearch

## installation
````bash
  $ npm install -g meili-sync
````

## usage
````bash
  meili-sync <configFile>
````

### docker
````bash
  docker pull maxnowack/meili-sync
  docker run -v /path/to/config.yaml:/config.yaml maxnowack/meili-sync
````

## configuration
````yaml
mongo:
  url: mongodb://localhost:27017/test # mongodb connection uri
  options: # connection options (see https://mongodb.github.io/node-mongodb-native/3.6/reference/connecting/connection-settings/)
    useNewUrlParser: true
    useUnifiedTopology: true
meili: # these options are directly passed through to the meilisearch client
  host: http://localhost:7700
  apiKey: 'abc123'
sync:
- indexName: videos # name of the meilisearch index. the index will be created automatically if it doesn't exist
  collectionName: videos # name of the mongodb collection
  selector: # mongodb query for selecting the documents for syncing
    deleted: false
    disabled: false
  fields: # field mapping
    title: # name of the field in the meilisearch index
      mongoField: title # path to the value of the field in the mongodb document (uses lodash.get; see https://lodash.com/docs/4.17.15#get)
    categories:
      mongoField: categories._id # array fields are resolved to all values automatically
    duration:
      mongoField: duration
    publishDate:
      mongoField: publishDate
    rating:
      mongoField: rating
    ratings:
      mongoField: ratings
    slug:
      mongoField: slug
    tags:
      mongoField: tags
    views:
      mongoField: views
````

## license
Licensed under MIT license. Copyright (c) 2020 Max Nowack

## contributions
Contributions are welcome. Please open issues and/or file Pull Requests.

---
_Source: https://npm.io/package/meili-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
