Comments (1)
A few things:
-
you don't want to create a new connection for every request. This is slow and wastes resources. Open the connection with mongoose and define your schema and model once when you start the application, then use the model within your route.
-
when you shut down your app, also close the mongoose connection
mongoose.disconnect()
. -
As for the debug issue, I think you're struggling with the async nature of I/O in node.js. In the example, the text search runs within the callback of the create() call so order matters.
from mongoose-text-search.
Related Issues (16)
- Support for populate HOT 3
- Supporting offset and sort options HOT 2
- Too little result HOT 1
- Does not work for MongoDB > 2.6
- text search not enabled
- mongoose-text-search is not working HOT 1
- Does this plugin supports accented chars?
- test issue 1
- Allow passing an object HOT 3
- textSearch hangs forever when searching a model with no records HOT 7
- How to skip? HOT 1
- Index document and a linked doc together HOT 1
- Pagination HOT 1
- Does not work with Mongoose 3.8.12 + Plugin setup
- Project not fully working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-text-search.