# dquery-mongo

> jQuery for your database

Latest version **0.0.2** (published 2014-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install dquery-mongo
pnpm add dquery-mongo
yarn add dquery-mongo
bun add dquery-mongo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-01-24 |
| First published | 2014-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dillon Krug |
| Maintainers | dillonkrug |
| Keywords | db, database, query |

## Links

- npm: https://www.npmjs.com/package/dquery-mongo
- Repository: https://github.com/dillonkrug/dquery
- Issues: https://github.com/dillonkrug/dquery/issues
- npm.io page: https://npm.io/package/dquery-mongo

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) *
- [mongojs](https://npm.io/package/mongojs.md) *
- [bluebird](https://npm.io/package/bluebird.md) *

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-01-24
- 0.0.1 — 2014-01-24
- 0.0.0 — 2014-01-24

## README

THIS IS A WORK IN PROGRESS

mostly just a placeholder at this point.

stay tuned.


## Concept
-------------

###app.js
```javascript
var $ = require('dquery');

$.connect('localhost:27017/test');  // Connect to database

$.collections({
    restaurants: 'restaurant',    // collectionName: documentName
    foods: 'food',
    users: 'user',
    orders: 'order'
});

$.loadDSS('./main.dss')
```
###main.dss
```css
.new {
    collection: 'restaurant';
    filter: {
        created: {
            $gte: Date(Date.now() - 1000*60*60*24*7)
        }
    }
}

order:placedBy($user) {
    filter: {
        user._id: $user._id
    }
}


```

###app.js

```javascript
app.get('/api/favorites', function(req, res){
    
    var _ids = $('user#' + req.session.user._id + ' > favorites > _id');
    
    $('restaurant:byIds($ids)', {$ids: _ids }).page(req.body).then(function(restaurants){
        res.send({
            success: true, 
            data: restaurants
        })
    }).catch(function(e){ 
        res.send({
            success:false, 
            msg: e.message
        }) 
    })


})
```

---
_Source: https://npm.io/package/dquery-mongo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
