D
D
doph2010-12-16 01:41:43
CouchDB
doph, 2010-12-16 01:41:43

Scheme -> Form -> couchDB?

How (the easiest way) to implement the following (maybe there is something ready):
1. Make a scheme, something like Name, description, weight, photo (attach)
2. Deploy it
3. Users see the form, fill it out
4 The data document appears in CouchDB.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Guketlev, 2010-12-16
@Yavanosta

Only this option comes to mind:
-create a document, for example type="myForm" containing, among other things, an array of fields:
{
...
type:"myForm",
fields:[
{
name:"Name",
type:"textbox",
id:" itemName",
required:true
...
},
...
]
...
}
- on the handler side (on the server side, or if you do not use the server but work with CouchDB directly from javascript, then there) select this document (for example, by creating a view by type)
- Generate form running through the array, give the user. To do this, you will need to write code to generate fields of the types you need.
-After filling, if necessary, control the filling by selecting the schema document from the cache again, run through the array of incoming data, cutting out fields from it that are not in the schema and control the values ​​that do not match the schema.
-drive new data into the couch.
But I would advise you to think thrice before using couch. On Windows, at least I had a lot of problems with it. First, I came across an Erlang bug that limits the maximum file size to four gigs (http://wiki.apache.org/couchdb/Installing_on_Windows) It was fixed, but so far I found a fix, while I rolled it up ... Then the database itself began to crumble when the file reached indexes of size 6- 8GB. It happened 2-3 times. Maybe, of course, due to the fact that I restarted the server during the regeneration of the view, but it's still not good. And if there was critical business information lying there, and someone distorted the power server? In general, I do not really trust him now.

A
Alexander, 2010-12-16
@akalend

you need to understand that couchDB is a data store that differs little in purpose from other stores. Therefore, the campaign is the same everywhere:
- we develop a data model
- in any language you know, we write a program that implements the input form.
- we enter the data, check it for compliance with the model, if there are no errors, we save the data in the storage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question