Queries returning scalar values

12 views
Skip to first unread message

mathias...@gmail.com

unread,
Sep 23, 2013, 3:47:48 AM9/23/13
to ashi...@googlegroups.com
I'm new to Ashikawa and ArangoDB. It seems that the Ashikawa Query class does not seem to be able to cope with scalar values getting returned from a query.

Example: 

list_user_names = db.query("for p in people return p.username")
names = q.to_a


This will fail with a NoMethodError in the Cursor class ("undefined method 'has_key?' for String).

Looking at the source of Cursor, it seems that 'detect_document_class_for' always expects a hash.

Is this by design and how do I work around this.

Thanks

Mathias

Lucas Dohmen

unread,
Sep 23, 2013, 4:32:14 AM9/23/13
to ashi...@googlegroups.com
Hi Mathias,

Welcome :)

Thanks for your report! This is a bug.

If you return `p` entirely, it will work. Then you can ask for the `username` on the returned object.
This is however only a workaround, I will fix this as soon as possible. I created the issue here:


Best Wishes,
Lucas

--
Sie haben diese Nachricht erhalten, weil Sie der Google Groups-Gruppe Ashikawa AvocadoDB beigetreten sind.
Um Ihr Abonnement für diese Gruppe zu beenden und keine E-Mails mehr von dieser Gruppe zu erhalten, senden Sie eine Email an ashikawa+u...@googlegroups.com.
Weitere Optionen: https://groups.google.com/groups/opt_out

signature.asc

mathias...@gmail.com

unread,
Sep 23, 2013, 4:45:04 AM9/23/13
to ashi...@googlegroups.com
Great, thanks - I'll work around this issue until the fix is available.

Regards

Mathias

Lucas Dohmen

unread,
Sep 23, 2013, 10:31:41 AM9/23/13
to ashi...@googlegroups.com
You're welcome :) Trying to get the new version ready sometime this week – maybe next week.

Best Wishes,
Lucas

signature.asc
Reply all
Reply to author
Forward
0 new messages