Skip to content

Commit 43bf92d

Browse files
committed
docs(faq): remove out of date faq
1 parent 27cd59e commit 43bf92d

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

docs/faq.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,6 @@ Because mongoose needs to define getters and setters for `nested.prop`, `nested`
9292
must always be defined as an object on a mongoose document, even if `nested`
9393
is undefined on the underlying [POJO](./guide.html#minimize).
9494

95-
<hr id="destructured-imports" />
96-
97-
<a class="anchor" href="#destructured-imports">**Q**</a>. When I use named imports like `import { set } from 'mongoose'`, I
98-
get a `TypeError`. What causes this issue and how can I fix it?
99-
100-
**A**. The only import syntax Mongoose supports is `import mongoose from 'mongoose'`.
101-
Syntaxes like `import * from 'mongoose'` or `import { model } from 'mongoose'` do **not** work.
102-
The global Mongoose object stores types, [global options](/docs/api.html#mongoose_Mongoose-set), and other important
103-
properties that Mongoose needs. When you do `import { model } from 'mongoose'`, the
104-
`this` value in `model()` is not the Mongoose global.
105-
106-
```javascript
107-
// file1.js
108-
exports.answer = 42;
109-
exports.foo = function() { console.log(this.answer); };
110-
111-
// file2.js
112-
const obj = require('./file1');
113-
obj.foo(); // "42"
114-
115-
// file3.js
116-
const { foo } = require('./file1');
117-
foo(); // "undefined"
118-
```
119-
12095
<hr id="arrow-functions" />
12196

12297
<a class="anchor" href="#arrow-functions">**Q**</a>. I'm using an arrow function for a [virtual](./guide.html#virtuals), [middleware](./middleware.html), [getter](./api.html#schematype_SchemaType-get)/[setter](./api.html#schematype_SchemaType-set), or [method](./guide.html#methods) and the value of `this` is wrong.

0 commit comments

Comments
 (0)