JavaScript Waterline.js: Populate association from list waterline populate association

Does anyone know if it's possible to populate a list of IDs for another model using waterline associations? I was trying to get the many-to-many association working but I don't think it applies here since one side of the relationship doesn't know about the other. Meaning, a user can be a part of many groups but groups don't know which users belong to them. For example, I'm currently working with a model with data in mongodb that looks like:

// Group
{
  _id: group01,
  var: 'somedata',
},
{
  _id: group02,
  var: 'somedata',
},
{
  _id: group03,
  var: 'somedata',
}

// User
{
  _id: 1234,
  name: 'Jim',
  groups: ['group01', 'group03']
}

And I'm trying to figure out if it's possible to setup the models with an association in such a way that the following is returned when querying the user:

// Req: /api/users/1234
// Desired result
{ 
  id: 1234,
  name: 'Jim',
  groups: [
    {
      _id: group01,
      var: 'somedata',
    },
    {
      _id: group03,
      var: 'somedata',
    }
  ]
}
Answer:1

I have a bar chart which use ChartJS that shows data. Based on the bar chart, I have the data: 15, 2, 0, 11. I can see all of these data in the bar, except 0. Is there a possibility to start the bar ...

I have a bar chart which use ChartJS that shows data. Based on the bar chart, I have the data: 15, 2, 0, 11. I can see all of these data in the bar, except 0. Is there a possibility to start the bar ...

  1. chart start with 0

I have a strange problem with ASP.NETmaster page and code behind. When Page.Header.DataBind() is called somehow all public method on my angular service are called. Here is my angular service: ...

I have a strange problem with ASP.NETmaster page and code behind. When Page.Header.DataBind() is called somehow all public method on my angular service are called. Here is my angular service: ...

  1. page.header.databind()
  2. page.header.databind failed to load viewstate
  3. page header databind in c#
  4. asp.net page.header.databind

function change(element) { document.getElementById('imageReplace').src = element; } function change_1() { document.getElementById('1').style.background = '#111'; document.getElementById('...

function change(element) { document.getElementById('imageReplace').src = element; } function change_1() { document.getElementById('1').style.background = '#111'; document.getElementById('...

  1. javascript takes long time load
  2. javascript window.open takes long time
  3. javascript function takes too long

I'm using Lodash to format a string like DIGITAL & TECHNOLOGY into Digital & Technology. I've tried with the following code: _.startCase(_.lowerCase('DIGITAL & TECHNOLOGY')); However, ...

I'm using Lodash to format a string like DIGITAL & TECHNOLOGY into Digital & Technology. I've tried with the following code: _.startCase(_.lowerCase('DIGITAL & TECHNOLOGY')); However, ...

  1. format strings with python
  2. format strings with printf
  3. format strings in c
  4. format strings in java
  5. format strings in javascript
  6. format strings in python 3
  7. format strings in r
  8. format strings in golang
  9. format strings in excel
  10. format strings python 3
  11. format strings in powershell
  12. format strings in matlab
  13. format strings in ruby
  14. format strings in swift
  15. format strings in js
  16. format strings in php
  17. format strings in sql
  18. format strings in python 2
  19. format strings in scala
  20. format strings in vb.net