Can collections be stored?

11 views
Skip to first unread message

tbatchelli

unread,
Feb 20, 2010, 7:06:55 PM2/20/10
to FleetDB
Is it possible to store a collection as a value, or only atomic values
are allowed as values? I tried to store a list as a value but it
didn't quite work, so I wonder if I am doing it wrong or if this is
not a feature of FleetDB to begin with?

Toni

Mark McGranaghan

unread,
Feb 20, 2010, 7:42:38 PM2/20/10
to FleetDB
Hi Toni,

FleetDB does not currently support collections as values in records.

I hope to support both maps and vectors as values in the near future.
Would you be willing to share how you might like to use collection
values in your app? Any additional examples that I have will help me
come up with a good interface and implementation.

- Mark

Toni Batchelli

unread,
Feb 20, 2010, 9:06:48 PM2/20/10
to fle...@googlegroups.com
My current use case is very simple (so far). I want to store records
of this form:

(def record {:id 123 :key1 "value 1" :key2 '("value 2.1" "value 2.2"
"value 2.n")})

the values in :key2 are at this point atomic themselves now. What I
would expect is that when I select this record from the DB I get back
a sequence. Following clojure's convention, I would not expect a
vector or a list back from the DB, but a seq. Also, I would not expect
at this point to be able to query on the elements contained in that
list.

I guess for now I will just create an indexed dummy map for the list.

--
Antoni Batchelli
- twitter: @tbatchelli
--- email: tbatc...@gmail.com
----- web: tbatchelli.org
------- web: disclojure.org

Reply all
Reply to author
Forward
0 new messages