pow-mongodb-fixtures
pow-mongodb-fixtures copied to clipboard
Uncaught TypeError: Cannot read property 'user1' of undefined
trafficstars
For the example
var users = exports.users = {
user1: {
_id: id(),
name: 'Michael'
},
user2: {
_id: id(),
name: 'George Michael',
father: users.user1._id
},
user3: {
_id: id('4ed2b809d7446b9a0e000014'),
name: 'Tobias'
}
}
Uncaught TypeError: Cannot read property 'user1' of undefined
at Object.
Node v4.2.4
Same issue here, did you manage to find a solution ? @Clan-Utility
I did something like this:
var users = exports.users = {
user1: {
_id: id(),
name: 'Michael'
},
user2: {
_id: id(),
name: 'George Michael'
},
user3: {
_id: id('4ed2b809d7446b9a0e000014'),
name: 'Tobias'
}
}
users.user2.father = users.user1._id;
Not elegant at all ...
Thanks for your feedback ;) At the end, I did it manually, without packages and it worked as I need to... (small fixtures so that's ok)