← Back to team overview

uonedb-qt team mailing list archive

Re: How to: Retrieving all docId in database

 

On 2013-03-12 08:04, Kevin Wright wrote:
> On 03/12/2013 07:52 AM, Kevin Wright wrote:
>> Today while trying to find a way of retrieving all the docId values in
>> the database I stumbled upon database.listDocs().
> I forgot to mention the "how to" part of my how to.
>
> listDocs() returns an array containing all the docId values in the
> database. While very simple once the developer is aware of this it is
> now also demonstrated in examples/u1db-qt-example-3.qml.
>
>> I was wondering if "listDocs" matches the principles outlined in the
>> "Six Characteristics of Good APIs" (http://bit.ly/15JhbaZ)?

I literally added all Database methods on the fly, none of these follow
the API proposal and they change behavior as needed. We need to add
Javascript API methods that we choose to support and leave internally
used methods alone.
Below is the original API proposal, which is still up for discussion:


Database:
append([docId, ]json)
remove(docId)
sync(URL, credentials)

Document:
save

ciao,
    Christian



References