Skip to content

Commit 158c5dd

Browse files
author
Gabriel Montalvo
committed
adds list documents example
1 parent 5fb78eb commit 158c5dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ mongolab.listDatabases(function (err, data) {
3434
});
3535
```
3636

37+
**List available documents for a given collection**
38+
39+
```javascript
40+
var options = {
41+
database: 'exampledb',
42+
collectionName: 'examples',
43+
query: '{ "key": "value" }'
44+
};
45+
46+
mongolab.listDocuments(options, function (err, data) {
47+
console.log(data); //=> [ { _id: 1234, ... } ]
48+
});
49+
```
3750
### Methods
3851

3952
#### `listDatabases`

0 commit comments

Comments
 (0)