CouchDB Library
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9853
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: CouchDB Library
I like to think of document stores as persistent arrays. They have the same name-value simplicity, but accessed from disk and so not limited to memory. But unlike arrays, they include options for querying, and automatically saving dynamically-updated query results in the form of "materialized views". And the better ones like CouchDB include powerful extras for replication across clusters if you need it (I don't, but it would be a good problem to have).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: CouchDB Library
I will see what I can dig up in terms of a demo app
the data will ultimately arrive as an array with the documents you've accessed
in terms of populating fields etc... it wouldn't be much different than you would with any data source, which is to say you would need to write out that code e.g.:
put tResultsArray["record101"]["first name"] into field "firstName"
put tResultsArray["record101"]["last name"] into field "lastName"
once you get used to Mango (based on the MongoDB query system) searching documents is pretty easy, for example:
-- this would produce an array of names and emails of anyone born between 1970 and 1990
the data will ultimately arrive as an array with the documents you've accessed
in terms of populating fields etc... it wouldn't be much different than you would with any data source, which is to say you would need to write out that code e.g.:
put tResultsArray["record101"]["first name"] into field "firstName"
put tResultsArray["record101"]["last name"] into field "lastName"
once you get used to Mango (based on the MongoDB query system) searching documents is pretty easy, for example:
Code: Select all
put 19700101 into tQuery["selector"]["$and"][1]["$gte"]["birthdate"]
put 19901231 into tQuery["selector"]["$and"][1]["$lte"]["birthdate"]
put "name" into tQuery["fields"][1]
put "email" into tQuery["fields"][2]
put couch.post("find",theURL,theDBname,tQuery) into tResults
stam wrote: ↑Sun Nov 08, 2020 7:02 pmThanks @pink,
Daybed library for couchDB looks very interesting... but my mindset is so SQL focused i keep thinking in terms of SQL approach which is probably not optimal for couchDB.
Is anyone able to share an actual working stack with CRUD operations in action, populating list boxes, related fields, updating etc with couchDB? (sorry, i know i shouldn't say 'related'). Reading the API kinda makes sense but i keep thinking in terms of relational databases...
Would be really great if someone could share a stack where either couchDB and/or Daybed were used 'in real life'
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
Re: CouchDB Library
By the way, over the last couple of weeks I've made a number of updates to the library, especially related to improving/optimizing the sync functions
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
-
- VIP Livecode Opensource Backer
- Posts: 9853
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: CouchDB Library
Very valuable stuff - thank you!
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: CouchDB Library
Thanks Greg, that's really appreciated!
-
- Posts: 16
- Joined: Tue Jun 19, 2018 8:50 am
- Location: DK/DE
- Contact:
CouchDB - Where to start?
Hi there
and sorry, if I'm ending up in the wrong category – I should definitely stick to the newbie corner, but on the other hand
my question is absolute CouchDB-related. I've read the posts, watched the YouTube video, purchased the udemy course,
downloaded the "CouchDB library" and I'm still don't able to get it to work.
CouchDB and LiveCode are running smoothly, but i'm failing just on installing the "library". There is no documentation?
In the meantime I stumbled across multiple different hints and docs, but I can't imagine that it's so hard to use a library?
(The extension builder does'nt work and crashes LiveCode at the end.)
I#m completely lost :-(
Thank you in advance
Jan
and sorry, if I'm ending up in the wrong category – I should definitely stick to the newbie corner, but on the other hand
my question is absolute CouchDB-related. I've read the posts, watched the YouTube video, purchased the udemy course,
downloaded the "CouchDB library" and I'm still don't able to get it to work.
CouchDB and LiveCode are running smoothly, but i'm failing just on installing the "library". There is no documentation?
In the meantime I stumbled across multiple different hints and docs, but I can't imagine that it's so hard to use a library?
(The extension builder does'nt work and crashes LiveCode at the end.)
I#m completely lost :-(
Thank you in advance
Jan
Re: CouchDB - Where to start?
Sorry, I did not get a notification of this post and I'm sure this is waaaaaay too late.
You need to put the library into the message path somehow, for example:
- paste the library into the stack script, this would be the simplest approach
- make a substack with the library and access it with the "start using" command
- put the library into any object and use the "insert script" command
You need to put the library into the message path somehow, for example:
- paste the library into the stack script, this would be the simplest approach
- make a substack with the library and access it with the "start using" command
Code: Select all
start using stack "couchdblib"
Code: Select all
insert the script of button "couchdblib" into back
stoltenberg wrote: ↑Sat Jan 02, 2021 7:26 pmHi there
and sorry, if I'm ending up in the wrong category – I should definitely stick to the newbie corner, but on the other hand
my question is absolute CouchDB-related. I've read the posts, watched the YouTube video, purchased the udemy course,
downloaded the "CouchDB library" and I'm still don't able to get it to work.
CouchDB and LiveCode are running smoothly, but i'm failing just on installing the "library". There is no documentation?
In the meantime I stumbled across multiple different hints and docs, but I can't imagine that it's so hard to use a library?
(The extension builder does'nt work and crashes LiveCode at the end.)
I#m completely lost
Thank you in advance
Jan
Greg (pink) Miller
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
MadPink, LLC
I'm Mad, Pink and Dangerous to Know
-
- Posts: 16
- Joined: Tue Jun 19, 2018 8:50 am
- Location: DK/DE
- Contact:
Re: CouchDB Library
(… never to late, as i'm stating with my latency ;-) Thanks a lot for your support!)