Skip to content

Unable to create subscribe query #52

Open
@nickasd

Description

@nickasd

Until now I used the default database adapter for ShareDB, but since I want to support persistent storage, I decided to use this adapter. Only there seems to be a problem when calling connection.createSubscribeQuery(...):

TypeError: Cannot read property '$query' of undefined
    at DB.ShareDbMongo.checkQuery (node_modules\sharedb-mongo\index.js:853:12)
    at DB.ShareDbMongo._getSafeParsedQuery (node_modules\sharedb-mongo\index.js:939:18)
    at DB.ShareDbMongo._query (node_modules\sharedb-mongo\index.js:625:21)
    at node_modules\sharedb-mongo\index.js:686:10
    at node_modules\sharedb-mongo\index.js:74:12
    at DB.ShareDbMongo.getDbs (node_modules\sharedb-mongo\index.js:109:26)
    at DB.ShareDbMongo.getCollection (node_modules\sharedb-mongo\index.js:71:8)
    at DB.ShareDbMongo.query (node_modules\sharedb-mongo\index.js:683:8)
    at Backend._query (node_modules\sharedb\lib\backend.js:495:14)
    at node_modules\sharedb\lib\backend.js:452:15

This is the code which creates the ShareDB backend:

var ShareDB = require('sharedb');
var ShareDBMongo = require('sharedb-mongo');
var sharedb = new ShareDB({db: ShareDBMongo('mongodb://localhost:27017')});
var connection = sharedb.connect();

Everything used to run correctly before (without providing the option, i.e. just using new ShareDB()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions