We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I am not sure if this is a bug, or if this works as designed.
I use trailpack-waterline for my ORM and mongodb.
trailpack-waterline
mongodb
Here is my footprints.js :
models: { options: { /** * Whether to populate all model associations by default (for "find") */ populate: true },
Then, when I perform a GET request :
GET
GET /user HTTP/1.1 Host: localhost:3000 Content-Type: application/json Cache-Control: no-cache Postman-Token: c2680799-ac9a-b0ef-be1d-2a9222303881
{ "address": "5754340ddd1aa8442a6df9e9", "email": "[email protected]", "firstName": "Kevin", "lastName": "Nguyen", "createdAt": "2016-05-29T14:01:02.953Z", "updatedAt": "2016-06-05T14:15:41.832Z", "id": "574af61e0d08d6a23108467f" },
The address attribute is not populated as I expect. I have to make this request to have my attribute populated :
GET /user?populate=address HTTP/1.1 Host: localhost:3000 Content-Type: application/json Cache-Control: no-cache Postman-Token: 405fcb38-41f4-ae1c-f9ed-f223f14ea46c
{ "address": { "streetAddress": "1360 route des Dolines", "zipCode": "06560", "city": "Sophia-Antipolis", "createdAt": "2016-06-05T14:15:41.822Z", "updatedAt": "2016-06-05T14:15:41.822Z", "id": "5754340ddd1aa8442a6df9e9" }, "email": "[email protected]", "firstName": "Kevin", "lastName": "Nguyen", "createdAt": "2016-05-29T14:01:02.953Z", "updatedAt": "2016-06-05T14:15:41.832Z", "id": "574af61e0d08d6a23108467f" },
So the question is : What if I have many attributes I want to populate in the GET request ?
I also have another question :
In my client, I want to perform an update on a user, and this is working, although I am surprised :
user
this.$http({ url: `/user/${user.id}`, method: 'PUT', data: { firstName: user.firstName, lastName: user.lastName, address: { streetAddress: user.address.streetAddress, zipCode: user.address.zipCode, city: user.address.city } } })
Trails response on a PUT request gives me a user but the address attribute is still not populated. BTW, the address field is well updated.
PUT
address
Thanks for explaining me how this works! :)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I am not sure if this is a bug, or if this works as designed.
I use
trailpack-waterline
for my ORM andmongodb
.Here is my footprints.js :
Then, when I perform a
GET
request :The address attribute is not populated as I expect. I have to make this request to have my attribute populated :
So the question is : What if I have many attributes I want to populate in the
GET
request ?I also have another question :
In my client, I want to perform an update on a
user
, and this is working, although I am surprised :Trails response on a
PUT
request gives me auser
but theaddress
attribute is still not populated. BTW, theaddress
field is well updated.Thanks for explaining me how this works! :)
The text was updated successfully, but these errors were encountered: