Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meteor does not currently support objects other than ObjectID as ids #349

Open
hanselke opened this issue Jan 13, 2020 · 0 comments
Open

Comments

@hanselke
Copy link

hanselke commented Jan 13, 2020

I am doing

`Meteor.publish "products",(projectId) ->

suppliers = MyOpenBSuppliers.find({},{fields:{projectId}}).fetch()
suppliersArray = suppliers.map (supplier) ->
    return  supplier.projectId
suppliersArray.push(projectId)

regex = []
suppliersArray.forEach (supplier,i) ->
    regex[i] = new RegExp(supplier)

console.log "products publish is subscribed for ",projectId,suppliersArray,regex
return Products.find {_id: { $in: regex}}`

the console log output is

products publish is subscribed for 2438 [ 2744, 2438 ] [ /2744/, /2438/ ]

It works perfectly fine without redis-oplog running.

With redis-oplog running i get

`
Exception from sub products id 2MpwRzwifJxxXN2qZ Error: Meteor does not currently support objects other than ObjectID as ids

at Object.MongoID.idStringify.id [as idStringify] (packages/mongo-id/id.js:77:11)

at getDedicatedChannel (packages/cultofcoders:redis-oplog/lib/utils/getDedicatedChannel.js:5:53)

at ids.map.id (packages/cultofcoders:redis-oplog/lib/redis/RedisSubscriber.js:42:38)
at Array.map ()

at RedisSubscriber.getChannels (packages/cultofcoders:redis-oplog/lib/redis/RedisSubscriber.js:42:28)

at new RedisSubscriber (packages/cultofcoders:redis-oplog/lib/redis/RedisSubscriber.js:21:30)

at new RedisOplogObserveDriver (packages/cultofcoders:redis-oplog/lib/mongo/RedisOplogObserveDriver.js:60:32)

at MongoConnection._observeChanges (packages/cultofcoders:redis-oplog/lib/mongo/observeChanges.js:123:25)
at Cursor.observeChanges (packages/mongo/mongo_driver.js:947:22)
at Function._publishCursor (packages/mongo/collection.js:365:32)
at Cursor._publishCursor (packages/mongo/mongo_driver.js:910:27)
at Subscription._publishHandlerResult (packages/ddp-server/livedata_server.js:1090:13)
at Subscription._runHandler (packages/ddp-server/livedata_server.js:1063:10)
at packages/ddp-server/livedata_server.js:827:16
at Map.forEach ()
at packages/ddp-server/livedata_server.js:822:20
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at Session._setUserId (packages/ddp-server/livedata_server.js:816:34)
at MethodInvocation.setUserId [as _setUserId] (packages/ddp-server/livedata_server.js:677:14)
at MethodInvocation.setUserId (packages/ddp-common/method_invocation.js:92:10)
at AccountsServer._loginUser (packages/accounts-base/accounts_server.js:287:22)
at MethodInvocation.methods.getNewToken (packages/accounts-base/accounts_server.js:618:23)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
at Promise (packages/ddp-server/livedata_server.js:715:46)
at new Promise ()
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43`

Objective is to publish a subscription that uses { $in: [array of regex]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant