hapi-mongo-models
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "hapi-mongo-models", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "MongoDB object models for hapi applications", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -132,3 +132,3 @@ # hapi-mongo-models | ||
- `url` - a string representing the connection url for MongoDB. | ||
- `options` - an optional object passed to the MongoDB's native connect function. | ||
- `options` - an optional object passed to MongoDB's native connect function. | ||
- `autoIndex` - a boolean specifying if the plugin should call `ensureIndex` for each | ||
@@ -222,3 +222,3 @@ model. Defaults to `true`. Typically set to `false` in production environments. | ||
If you wanted to use plain strings for your document `id` properties you could: | ||
If you wanted to use plain strings for your document `_id` properties you could: | ||
@@ -368,6 +368,12 @@ ```js | ||
- `fields` - a string with space separated fields. | ||
- `fields` - a string with space separated field names. | ||
Returns a MongoDB friendly fields object. | ||
```js | ||
Kitten.fieldsAdapter('name email'); | ||
// { name: true, 'email': true } | ||
``` | ||
#### `sortAdapter(sorts)` | ||
@@ -378,7 +384,13 @@ | ||
- `sorts` - a string with space separated fields. Fields may be prefixed with | ||
`-` to indicate decending sort order. | ||
- `sorts` - a string with space separated field names. Fields may be prefixed | ||
with `-` to indicate decending sort order. | ||
Returns a MongoDB friendly sort object. | ||
```js | ||
Kitten.sortAdapter('name -email'); | ||
// { name: 1, email: -1 } | ||
``` | ||
#### `count(filter, [options], callback)` | ||
@@ -506,7 +518,6 @@ | ||
method. | ||
- `callback` - the callback method using the signature `function (err, count)` | ||
- `callback` - the callback method using the signature `function (err, result)` | ||
where: | ||
- `err` - if the query failed, the error reason, otherwise `null`. | ||
- `count` - if the command succeeded, a number indicating how many documents | ||
were deleted. | ||
- `result` - if the query succeeded, a document as a class instance. | ||
@@ -513,0 +524,0 @@ #### `insertOne(doc, [options], callback)` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81402
651