db-migrate / db-migrate/node-db-migrate

How to make more complex queries?

Open
#261 3 comments 0 reactions 1 assignee Claimed by @wzrdtales View on GitHub
feature question
Dominant language
JavaScript
Stars
2.3k
Forks
361
PR merge metrics
No merged PRs in 30d

Description

Hi, I want to completely change the structure of my database (mongodb), so the four methods provided by the API will not suffice. How do I use the mongodb API from within migrations?
I am currently stuck with this:

```
exports.up = (db, callback) ->
db.connection._db.collection('users').find().toArray((err, arr) ->
console.log err
console.log arr
callback()
)
```

Which yields:

```
{ [MongoError: Connection Closed By Application] name: 'MongoError' }
null
```
##

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/11880648-how-to-make-more-complex-queries?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.