# elasticgoose-beta

> It's like mongoose, but for elasticsearch.

Latest version **1.0.0** (published 2016-05-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install elasticgoose-beta
pnpm add elasticgoose-beta
yarn add elasticgoose-beta
bun add elasticgoose-beta
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-05-29 |
| First published | 2016-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peter Brandt |
| Maintainers | pbrandt1 |

## Links

- npm: https://www.npmjs.com/package/elasticgoose-beta
- npm.io page: https://npm.io/package/elasticgoose-beta

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [queue](https://npm.io/package/queue.md) ^3.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [elasticsearch](https://npm.io/package/elasticsearch.md) ^10.1.3

## Recent versions

- 1.0.0 (latest) — 2016-05-29

## README

# Elasticgoose

It's like mongoose, but for elasticsearch.

(not published to npm yet)

# Usage

```javascript
var elasticgoose = require('../src/elasticgoose');

elasticgoose.connect({
  host: 'localhost:9200',
  log: 'info',
  apiVersion: '2.2'
});

var posts = elasticgoose.Model('test_index', 'post_type', {
  user: String,
  message: String,
  posted: {
    type: Date,
    default: Date.now
  }
})

posts.insert({
  user: 'peter',
  message: 'help me'
}, function(e, r) {
  console.log(r); // ur doc, with the default value all filled in
})

posts.find({user: 'peter'})
  .sort('posted')
  .skip(1)
  .limit(5)
  .select('user posted')
  .exec(function(e, r) {
    console.log(r);
  })

```

# Learning about Elasticsearch

* https://www.elastic.co/blog/index-vs-type
* https://www.elastic.co/blog/changing-mapping-with-zero-downtime


# TODO

* update
* insert array of documents
* analyzers in mapping definition
* github.io page

### ISC License

Copyright (c) 2016, Peter Brandt

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

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