sails-arangodb icon indicating copy to clipboard operation
sails-arangodb copied to clipboard

support select

Open roboojack opened this issue 10 years ago • 9 comments

Hi, would it be difficult to implement select functionality?

roboojack avatar May 07 '15 19:05 roboojack

+1

jhawlwut avatar May 08 '15 01:05 jhawlwut

You mean this: https://github.com/balderdashy/waterline/issues/73 ?

rosmo avatar May 08 '15 07:05 rosmo

Yes, that's it

I was able to build an options.select function;however, I'm having trouble getting it to transform into the AQL structure for 'RETURN'

It builds into something like {value: d.name}

On Friday, May 8, 2015, Taneli Leppä [email protected] wrote:

You mean this: balderdashy/waterline#73 https://github.com/balderdashy/waterline/issues/73 ?

— Reply to this email directly or view it on GitHub https://github.com/rosmo/sails-arangodb/issues/6#issuecomment-100139784.

Sent from my iPhone

jhawlwut avatar May 08 '15 09:05 jhawlwut

Yes, but send the RETURN [x.attribute1, x.attribute2, x.attribute3] part of the AQL to ArangoDB so that we don't have to filter the JSON that's returned. It's a query optimization, but it would be a nice feature.

roboojack avatar May 08 '15 12:05 roboojack

Can you guys give me an example how you'd like this to work? I'm using Model.query mostly for my queries (since most of my queries are GRAPH_NEIGHBORS lookups) and those have to specified completely manually.

rosmo avatar May 20 '15 18:05 rosmo

Can you try this branch: https://github.com/rosmo/sails-arangodb/tree/select-support

It (at least tries to) implements Model.find({ where : { ... }, select: [ 'field1', field2', ...] }) support.

rosmo avatar May 23 '15 14:05 rosmo

I will work on getting this feature into master.

gabriel-letarte avatar Jan 04 '16 16:01 gabriel-letarte

Is it still planned for where and select support to be merged/supported? I'm using waterline from feathersjs - would be very nice to be able to select fields etc

gbevan avatar Nov 19 '16 18:11 gbevan

This pull request (in progress) implements select support - https://github.com/gabriel-letarte/sails-arangodb/pull/22

gbevan avatar Apr 12 '17 20:04 gbevan