Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-mongo-models

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-mongo-models - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"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)`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc