mongoose 6.7.4 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # Mongoose
2
2
 
3
- Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks.
3
+ Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed to work in an asynchronous environment. Mongoose supports [Node.js](https://nodejs.org/en/) and [Deno](https://deno.land/) (alpha).
4
4
 
5
- [![Slack Status](https://img.shields.io/badge/slack-mongoosejsteam-34D058.svg?logo=slack )](https://mongoosejsteam.slack.com)
6
5
  [![Build Status](https://github.com/Automattic/mongoose/workflows/Test/badge.svg)](https://github.com/Automattic/mongoose)
7
6
  [![NPM version](https://badge.fury.io/js/mongoose.svg)](http://badge.fury.io/js/mongoose)
7
+ [![Deno version](https://deno.land/badge/mongoose/version)](https://deno.land/x/mongoose)
8
+ [![Deno popularity](https://deno.land/badge/mongoose/popularity)](https://deno.land/x/mongoose)
8
9
 
9
10
  [![npm](https://nodei.co/npm/mongoose.png)](https://www.npmjs.com/package/mongoose)
10
11
 
@@ -45,6 +46,8 @@ First install [Node.js](http://nodejs.org/) and [MongoDB](https://www.mongodb.or
45
46
  $ npm install mongoose
46
47
  ```
47
48
 
49
+ Mongoose 6.8.0 also includes alpha support for [Deno](https://deno.land/).
50
+
48
51
  ## Importing
49
52
 
50
53
  ```javascript
@@ -55,6 +58,24 @@ const mongoose = require('mongoose');
55
58
  import mongoose from 'mongoose';
56
59
  ```
57
60
 
61
+ Or, using [Deno's `createRequire()` for CommonJS support](https://deno.land/std@0.113.0/node/README.md?source=#commonjs-modules-loading) as follows.
62
+
63
+ ```javascript
64
+ import { createRequire } from "https://deno.land/std/node/module.ts";
65
+ const require = createRequire(import.meta.url);
66
+
67
+ const mongoose = require('mongoose');
68
+
69
+ mongoose.connect('mongodb://localhost:27017/test')
70
+ .then(() => console.log('Connected!'));
71
+ ```
72
+
73
+ You can then run the above script using the following.
74
+
75
+ ```
76
+ deno run --allow-net --allow-read --allow-sys --allow-env mongoose-test.js
77
+ ```
78
+
58
79
  ## Mongoose for Enterprise
59
80
 
60
81
  Available as part of the Tidelift Subscription
@@ -98,9 +119,9 @@ const BlogPost = new Schema({
98
119
  Aside from defining the structure of your documents and the types of data you're storing, a Schema handles the definition of:
99
120
 
100
121
  * [Validators](http://mongoosejs.com/docs/validation.html) (async and sync)
101
- * [Defaults](http://mongoosejs.com/docs/api.html#schematype_SchemaType-default)
102
- * [Getters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-get)
103
- * [Setters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set)
122
+ * [Defaults](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-default)
123
+ * [Getters](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-get)
124
+ * [Setters](http://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-set)
104
125
  * [Indexes](http://mongoosejs.com/docs/guide.html#indexes)
105
126
  * [Middleware](http://mongoosejs.com/docs/middleware.html)
106
127
  * [Methods](http://mongoosejs.com/docs/guide.html#methods) definition
@@ -316,7 +337,7 @@ return a cursor.
316
337
 
317
338
  ## API Docs
318
339
 
319
- Find the API docs [here](http://mongoosejs.com/docs/api.html), generated using [dox](https://github.com/tj/dox)
340
+ Find the API docs [here](http://mongoosejs.com/docs/api/mongoose.html), generated using [dox](https://github.com/tj/dox)
320
341
  and [acquit](https://github.com/vkarpov15/acquit).
321
342
 
322
343
  ## Related Projects