Monday 25 January 2016

Sqlite3 help

Hey gang,I've just working my way through a book called Node Craftsman, and am doing some database stuff at the moment.I've got a test failing at the moment, we add three rows to the db, then send a request to our server (basically just SELECT * FROM table), but the response has an extra line;Expected:{ _items: [ { id: 1, value: 'Aubergine', categoryID: 1 }, { id: 2, value: 'Onion', categoryID: 1 }, { id: 3, value: 'Knife', categoryID: 2 } ] } Actual:{ _items: [ { id: 1, value: 'Aubergine', categoryID: 1 }, { id: 2, value: 'Onion', categoryID: 1 }, { id: 3, value: 'Knife', categoryID: 2 } ], _links: { parent: { href: 'http://localhost:8080/api' } } } So after poring over these two objects for ages expecting me to have misspelled Aubergine, I realise there's an extra object in the actual response.Ok so what's up with _links?Here's what my server looks like: http://ift.tt/1ntzIXc (forgive my spacious formatting, I need all the help I can get to get my head around all the callbacks).Is '_links' some metadata added to the bottom of tables? What's the easiest way to prune it from results?Any help, pointers, directions, links to _links info you guys could provide would be super helpful.Thanks a bunch, thombsaway

Submitted January 25, 2016 at 09:26AM by thombsaway

No comments:

Post a Comment