# continuable-mongo

> A thin mongo wrapper which exposes mongodb as continuables

Latest version **0.6.3** (published 2013-09-09) · 0 weekly downloads

## Install

```sh
npm install continuable-mongo
pnpm add continuable-mongo
yarn add continuable-mongo
bun add continuable-mongo
```

## 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.6.3 |
| Published | 2013-09-09 |
| First published | 2013-05-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Raynos |
| Maintainers | raynos |

## Links

- npm: https://www.npmjs.com/package/continuable-mongo
- Repository: https://github.com/Colingo/continuable-mongo
- Issues: https://github.com/Colingo/continuable-mongo/issues
- npm.io page: https://npm.io/package/continuable-mongo

## Dependencies (5)

- [mongodb](https://npm.io/package/mongodb.md) ~1.3.18
- [through](https://npm.io/package/through.md) ~2.3.4
- [individual](https://npm.io/package/individual.md) ~0.1.1
- [continuable](https://npm.io/package/continuable.md) ~1.1.8
- [continuable-cache](https://npm.io/package/continuable-cache.md) ~0.1.1

## Recent versions

- 0.6.3 (latest) — 2013-09-09
- 0.6.2 — 2013-09-09
- 0.6.1 — 2013-08-21
- 0.5.1 — 2013-08-14
- 0.4.1 — 2013-07-12
- 0.3.1 — 2013-05-15
- 0.2.0 — 2013-05-15
- 0.1.7 — 2013-05-13
- 0.1.6 — 2013-05-08
- 0.1.5 — 2013-05-08
- 0.1.4 — 2013-05-08
- 0.1.3 — 2013-05-08
- 0.1.2 — 2013-05-08

## README

# continuable-mongo

<!-- [![build status][1]][2] [![dependency status][3]][4]

[![browser support][5]][6] -->

A thin mongo wrapper which exposes mongodb as continuables

## Example

For now you can pass either a callback to each collection method
  or not pass in a callback and the function returns a continuable

```js
var mongo = require("continuable-mongo")

var client = mongo("mongodb://localhost:27017/my_db")

var myCollection = client.collection("my-collection")

myCollection.insert([{
    some: "key",
    value: "pair"
}], function (err, inserted) {
    // inserted records

    myCollection.findOne({
        some: "key"
    }, function (err, result) {
        // result.value === "pair"

        console.log("result", result)
    })
})
```

## Differences from mongodb/Collection

### `Collection#findById`

a collection object returned by `client.collection` has an
    additional `.findById(id)` method. This is used to find
    a record by it's mongodb _id. It's assumed that id is a string
    or otherwise valid argument to `ObjectID` and that the _id field
    on the mongodb record is a `ObjectID`

The purpose of this method is not have to manually require `ObjectID`
    to avoid littering your code base to mongodb internal references.

If you do need access to the raw ObjectID function there is a safer
    variant that can be required `"continuable-mongo/object-id"` which
    either returns a mongodb/ObjectID instance or will return an `Error`.
    Which means it's a function which will not throw but does need
    checking on the returned value.


## Installation

`npm install continuable-mongo`

## Contributors

 - Raynos

## MIT Licenced

  [1]: https://secure.travis-ci.org/Colingo/continuable-mongo.png
  [2]: http://travis-ci.org/Colingo/continuable-mongo
  [3]: https://david-dm.org/Colingo/continuable-mongo/status.png
  [4]: https://david-dm.org/Colingo/continuable-mongo
  [5]: https://ci.testling.com/Colingo/continuable-mongo.png
  [6]: https://ci.testling.com/Colingo/continuable-mongo

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