0

Followed the documentation to create Users to Pets - Many to Many Relationship in Sails JS V10.5 - BluePrint API with MongoDB v2.6

Yet localhost:1337/user/54e38754b27f02212458e68e/pets?name=Pinkie%20Pie Finding the Owner's Pet by Name works ..

{ "name": "Pinkie Pie", "color": "pink", "createdAt": "2015-02-17T18:24:20.720Z", "updatedAt": "2015-02-17T18:24:20.720Z", "id": "54e38754b27f02212458e691" }

But when the same pet is accessed via its ID localhost:1337/user/54e38754b27f02212458e68e/pets?id=54e38754b27f02212458e691 , the REST API is not returning any value.

Can you please let me know, how to enable additional logs to troubleshoot this basic Blueprint REST API access?

Raj Rajen
  • 203
  • 2
  • 17

1 Answers1

0

Have you tried using

GET /user/54e38754b27f02212458e68e/pets/54e38754b27f02212458e691

? The same applies also to POST and DELETE requests.

Blade1336
  • 71
  • 4
  • Hi Erk, That is not workign .. Thats the concern.https://docs.google.com/document/d/1frEGpdapa2vndq5ibLCZcpeGjiX7tq-NJ41DzDVjSr8/edit#heading=h.rvv2znfihuk – Raj Rajen Feb 18 '15 at 18:17
  • I tried all the following yet it didn’t work. I mean No RESULT . http://localhost:1337/user/54e38754b27f02212458e68e/pets?id=54e38754b27f02212458e691 http://localhost:1337/user/54e38754b27f02212458e68e/pets/54e38754b27f02212458e691 http://localhost:1337/user/54e38754b27f02212458e68e/pets?pets.id=54e38754b27f02212458e691 all 3 of them didn't work .. – Raj Rajen Feb 18 '15 at 18:24
  • The Source code is uploaded https://drive.google.com/file/d/0B0fs0t6Bg6GGQ05SajJrMHpMYmc/view?usp=sharing To Test the same. If you have MongoDB, please create DBS - company1 ( as you can see in connection.js ) . To Generate sample data between user & pets just enter http://localhost1337/user/hello. This function will load few users & pets and link them together. Then you will be able to access localhost:1337/user/54e38754b27f02212458e68e/pets/54e38754b27f02212458e691 If this is not working then how do we enable the debugger for Blueprint to troubleshoot this issue. Please let me know. – Raj Rajen Feb 18 '15 at 22:58