#44 ✓resolved
Yurii Rashkovskii

Add named document functionality

Reported by Yurii Rashkovskii | May 1st, 2008 @ 07:59 AM | in 0.0.3

The idea is that we seem to have a desperate need in documents identified by their name's UUIDv5.

Here is an example how I might want to do this:

# If there is no such document
Page("/main") # => creates it (no slots defined)
Page("/main", :slot => "value") # => creates it (with slots)
Page(store, "/main") # => creates it in specified store
# If there is such document already:
Page("/main") # => find and return it
Page("/main", :slot => "value") # => finds it, if slots differ, then it update_slot! it
Page(store, "/main") # => finds it in specified store

If called as SomeMeta(), then it should find only documents with given meta. To make it easy, I think we should prepend (or append) name with meta uuid

 document.uuid = uuidv5(meta.uuid + name)

This will guarantee no UUIDv5 clashes.

If one wants broader search, he should do it as follows:

Document("page:/main")

Looks pretty nice, I think, and basically not really hard to implement.

P.S. It seems that I definitely need this functionality for Zoid to make things easier.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

StrokeDB is an embeddable distributed document database written in Ruby

Shared Ticket Bins