How to get server database info

53 views
Skip to first unread message

Ami Kapadia

unread,
Jul 17, 2014, 2:32:06 AM7/17/14
to mobile-c...@googlegroups.com
Hi!


I want to get server database update_seq. 

I am getting all information of local database using this code :

config.db.changes({since : config.info.update_seq}, function(err, change) 

{

console.log(config);

console.log(change);

}

Both gives local database info. But can't find any info about server database.

How can I get it?

Ami Kapadia

unread,
Jul 17, 2014, 12:37:43 PM7/17/14
to mobile-c...@googlegroups.com
Hi!

I am using :

Now, how can I fetch CouchDB server's database info like "update_seq", "doc_count"?
Here is information of my CouchDB database informations. How can I fetch it using JS? 
{"db_name":"amitesting","doc_count":477,"doc_del_count":6,"update_seq":522,"purge_seq":0,"compact_running":false,"disk_size":1028216,"data_size":324307,"instance_start_time":"1405537345886287","disk_format_version":6,"committed_update_seq":522}

Jens Alfke

unread,
Jul 17, 2014, 1:14:30 PM7/17/14
to mobile-c...@googlegroups.com

On Jul 17, 2014, at 9:37 AM, Ami Kapadia <ami....@gmail.com> wrote:

Now, how can I fetch CouchDB server's database info like "update_seq", "doc_count"?

Just use an XHR to GET /dbname from the remote server, and parse the response as JSON.
If you’d rather use a library, there are a bunch of JS CouchDB libraries; one is called ‘coux’ IIRC, or you can just google for them.

—Jens

Traun Leyden

unread,
Jul 17, 2014, 2:29:48 PM7/17/14
to mobile-c...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/3D4D1C1E-38A6-4149-B1E9-B104BA6B60EF%40couchbase.com.

For more options, visit https://groups.google.com/d/optout.

Ami Kapadia

unread,
Jul 18, 2014, 5:01:33 AM7/18/14
to mobile-c...@googlegroups.com
Hi Tarun!

I am using todolite-Phonegap which is also using coax internally. Check here : https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/modules.js

That's why I am having trouble when I include coux library.
Can I get server database information using this coax which I am currently using?

Thanks!


Jens Alfke

unread,
Jul 18, 2014, 6:44:03 PM7/18/14
to mobile-c...@googlegroups.com

On Jul 18, 2014, at 2:01 AM, Ami Kapadia <ami....@gmail.com> wrote:

I am using todolite-Phonegap which is also using coax internally. Check here : https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/modules.js
That's why I am having trouble when I include coux library.

I think coax and coux are just different forks of the same library. (JChris would know better.) You should be able to do it using coax. It’s just a simple XHR call.

—Jens

Ami Kapadia

unread,
Jul 19, 2014, 3:03:49 AM7/19/14
to mobile-c...@googlegroups.com

Yeah!

I tried to fetch data using coax which returns XMLHttpRequest object in return. So, again I have to parse it to JSON. That's reducing performance.

Instead of that, I am fetching database info using Angular $http object which is working very fast.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Nick Wood

unread,
Jul 19, 2014, 2:31:22 PM7/19/14
to mobile-couchbase
Glad $http object is working fast.  Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/R1Qw1seuFhw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/CALA2sAatOmqYPDLJjdi40V91RSLe2xuAf5pkVoFK4J4Oci5Ddg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages