Hello everyone, I am new to Sails js and mongoDB and feeling a bit lost at the moment.
I have set up two models with a many-to-many relationship:
User.js
module.exports = {
attributes: {
username: 'STRING',
password: 'STRING',
doors:{
collection: 'door',
via: 'users',
}
}
};
and Door.js
module.exports = {
attributes: {
name: 'STRING',
users:{
collection: 'user',
via: 'doors'
}
}
};
Everything is working as expected, I can create a user and a door and link them together. However, I would like to include another field in the association - an expiry date (for example, when the user's access to a specific door expires).
Any suggestions on how I can achieve this?