stream is not defined error
suhairelayadath opened this issue · 8 comments
Hi,
I am getting the following error
ReferenceError: stream is not defined at F:\mightybolder\boldersocial\node_modules\getstream-node\src\backends\mongoose.js:100:9 at F:\mightybolder\boldersocial\node_modules\mongoose\lib\model.js:3369:16 at next (F:\mightybolder\boldersocial\node_modules\mongoose\lib\model.js:2621:5) at populate (F:\mightybolder\boldersocial\node_modules\mongoose\lib\model.js:2709:12) at _populate (F:\mightybolder\boldersocial\node_modules\mongoose\lib\model.js:2611:5) at Function.Model.populate (F:\mightybolder\boldersocial\node_modules\mongoose\lib\model.js:2571:5) at model.populate (F:\mightybolder\boldersocial\node_modules\mongoose\lib\document.js:2449:22) at model.<anonymous> (F:\mightybolder\boldersocial\node_modules\getstream-node\src\backends\mongoose.js:98:9) at EventEmitter.<anonymous> (F:\mightybolder\boldersocial\node_modules\mongoose\lib\schema.js:1084:17) at emitTwo (events.js:106:13) at EventEmitter.emit (events.js:191:7)
In recent commit it seems to be that stream import is deleted from src\backends\mongoose.js.
Please help, thanks in advance
can you share the module with your Schema definitions?
Yes, This is the schema and models i have used.
var mongoose = require('mongoose');
var stream = require('getstream-node');
console.warn("We have imported stream ", stream.mongoose.activity);
// Define the schema
var userSchema = new mongoose.Schema({
_id: String,
email: String,
uid: String
});
var beatSchema = new mongoose.Schema({
content: String,
user: {
type: mongoose.Schema.Types.String,
ref: 'User'
}
});
// Compile the schema into models
var User = mongoose.model('User', userSchema);
var Beat = mongoose.model('Beat', beatSchema);
mongoose.connect('...');
beatSchema.plugin(stream.mongoose.activity);
stream.mongoose.setupMongoose(mongoose);Any answers ?
I have the same issue, have anyone a clue?
var stream = require('../index.js')
add this line to mongoose js file. stream is undefined variable and we need to load it.
Guys, any updates for this issue in the repo? Please, add var stream = require('../index.js'); to src/backends/mongoose.js file.
Thanks all – apologies for the delay. This is is now resolved.