Scheme -> Form -> couchDB?

0 like 0 dislike
6 views
How (the simplest way) to implement two things (might have something ready):


1. Make a diagram something like the Name, description, weight, photo (enclosure)

2. Deploy it

3. Users see a form, fill it

4. CouchDB appears in the data document.
by | 6 views

2 Answers

0 like 0 dislike
Comes to mind only such variant:
-create a document for example type="myForm" containing among other things an array of the fields:
{
...
type:"myForm",
fields:[
{
name:"Name",
type:"textbox",
id:"itemName",
required:true
...
},
...
]
...
}
-on the side of the handler (on the server, or if you are not using the server and work with CouchDB directly from JavaScript, it is there) select the document (for example creating a view by type)
-Generate the form pramehas the array, give the user. You will need to write code to generate the desired field types.
-After filling, if necessary, control the filling, again by choosing a schema document from couch, run through the array came data, cutting it from the fields which are not in the scheme and control values does not meet the diagram.
-to drive new data into the couch.
\r
But I would advise you to think three times before using the caps. On Windows at least I have a lot of problems with him. First encountered the bug in Erlang, limiting the maximum file size of four gigs (http://wiki.apache.org/couchdb/Installing_on_Windows) It was fixed, but yet have found a fix, while freewheeling... Then the base started to crumble when the index file sizes are 6-8Gb. 2-3 times there. Can certainly due to the fact that I rebooted the server during the view generation, but it's still not good. And if there is critical business information lay and the server on diet anyone wince? In General, I told him now do not trust.
by
0 like 0 dislike
you have to understand what couchDB is a datastore, not much different in purpose from other stores. For this hike the same everywhere:
— developed the data model
— any known language you write a program that implements the input form.
— enter your data, check them for compliance with the model, if no error data to be stored in the repository.
by

Related questions

0 like 0 dislike
1 answer
asked Apr 27, 2019 by taaadm
0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,858 users