|
1 | | -var MongoDBInstance = require('scout-brain').models.Instance; |
2 | | -var MongoDBCollectionCollection = require('scout-brain').models.CollectionCollection; |
| 1 | +var MongoDBInstance = require('mongodb-instance-model'); |
3 | 2 | var MongoDBCollection = require('./mongodb-collection'); |
4 | 3 | var scoutClientMixin = require('./scout-client-mixin'); |
5 | 4 | var selectableMixin = require('./selectable-collection-mixin'); |
6 | | -var types = require('./types'); |
| 5 | +var toNS = require('mongodb-ns'); |
7 | 6 |
|
8 | 7 | /** |
9 | 8 | * A user selectable collection of `MongoDBCollection`'s with `specialish` |
10 | 9 | * collections filtered out. |
11 | 10 | */ |
12 | | -var MongoDBCollectionOnInstanceCollection = MongoDBCollectionCollection.extend(selectableMixin, { |
| 11 | +var MongoDBCollectionOnInstanceCollection = MongoDBCollection.Collection.extend(selectableMixin, { |
13 | 12 | namespace: 'MongoDBCollectionOnInstanceCollection', |
14 | 13 | model: MongoDBCollection, |
15 | 14 | parse: function(res) { |
16 | 15 | return res.filter(function(d) { |
17 | | - return !types.ns(d._id).specialish; |
| 16 | + return !toNS(d._id).specialish; |
18 | 17 | }); |
19 | 18 | } |
20 | 19 | }); |
21 | 20 |
|
22 | 21 | /** |
23 | 22 | * Metadata for a MongoDB Instance, such as a `db.hostInfo()`, `db.listDatabases()`, |
24 | 23 | * `db.buildInfo()`, and more. |
25 | | - * @see https://github.com/10gen/scout/blob/dev/scout-brain/lib/models/instance.js |
| 24 | + * |
| 25 | + * @see http://npm.im/mongodb-instance-model |
26 | 26 | */ |
27 | 27 | module.exports = MongoDBInstance.extend(scoutClientMixin, { |
28 | 28 | namespace: 'MongoDBInstance', |
29 | | - children: { |
| 29 | + collections: { |
30 | 30 | collections: MongoDBCollectionOnInstanceCollection |
31 | 31 | }, |
32 | 32 | url: '/instance' |
|
0 commit comments