Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const announcement = await Team.update({}, {
- $push: {
- announcements: {fullname, description}
- }}, {multi: true, runValidators: true});
- if(announcement.nModified === 0) throw new Error('');
- res.send(announcement);
- next();
- const announcement = await Team.updateManu({}, {
- $push: {
- announcements: {fullname, description}
- }}, {runValidators: true});
- if(announcement.nModified === 0) throw new Error('');
- res.send(announcement);
- next();
- team: [
- {
- "name": "team 1"
- "announcements": [
- {
- "_id": "5cdd0bd9cc45120426c89f1c",
- "desc" : "test"
- }
- ]
- },
- {
- "name": "team 2"
- "announcements": [
- {
- "_id": "5cdd0bd9cc45120426c89f1c",
- "desc" : "test"
- }
- ]
- },
- {
- "name": "team 3"
- "announcements": [
- {
- "_id": "5cdd0bd9cc45120426c89f1c",
- "desc" : "test"
- }
- ]
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement