Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

RE: Delete document Tree Structure

Delete document Tree Structure
(32 lines)
Valid database names in 0.11
(9 lines)
May 27, 2010
Aun... สุวพรหม
Aun... สุวพรหม

   hi ,

         I am very new to couchdb,  in my design , i just keep parent id
of each documents.
such as if i would like to delete B, i know that to delete C(have B id)
and then I have find and
to delete E(have c id).... etc.

        my question is ....

        1. is this possible ????

        2. how do i pass the document id (such as B) to view that i would
like to search and delete document under its? 

        3. dose couchdb support delete document in view or i have to query
all of them than use http api to delete ?

         

thanks for every ideas 

A.







-------- Original Message --------

  
    
      Subject: 
      Re: Delete document Tree Structure
    
    
      Date: 
      Thu, 27 May 2010 06:43:58 +0200
    
    
      From: 
      J Chris Anderson <jch### @gmail.com>
    
    
      Reply-To: 
      use### @couchdb.apache.org <us### @couchdb.apache.org>
    
    
      To: 
      use### @couchdb.apache.org <us### @couchdb.apache.org>
    
  





On May 26, 2010, at 8:48 PM, Aun... ??????? wrote:

 
 
 Hi,
 
       I design document in couchdb to have relation something like
 
              directory
                    |
                    A---------D
                    |
                    B---------C
                                 |
                                 |
                                 E ------F
 
         if i would like to http (DELETE B) will delete all down
documents what is the possible solution to use.
 
                1.    can i create view and find relation and delete
all of them ?
                2.    get  relation by higher programming api (C#,PHP)
and then delete each one?
                3.    Do you have any solution to suggest on
this.....?
 

It is common to store the full path to each item, on the item, so you'd
have

B > C > E > F stored on F

then you can view easily across the tree.

however, reparenting a node, (say, moving B to become a child of D)
require asynchronous processing or a bulk docs request and is not
transactional.

Chris


 
 Thanks,
 A. 
 
 
 		 	   		  
 
Reply
Tags: delete
Messages in this thread
RE: Delete document Tree Structure
reply Re: Delete document Tree Structure
(69 lines) May 28, 2010 03:48
Similar Threads
Delete document Tree Structure

Hi,

       I design document in couchdb to have relation something like

              directory
                    |
                    A---------D
                    |
                    B---------C
                                 |
                                 |
                                 E ------F

         if i would like to http (DELETE B) will delete all down documents
what is the possible solution to use.

                1.    can i create view and find relation and delete all
of them ?
                2.    get  relation by higher programming api (C#,PHP) and
then delete each one?
                3.    Do you have any solution to suggest on this.....?


Thanks,
A. 


 		 	   		  

Re: Atomic Delete Document
Read this very carefully so you understand the semantics very clearly or
you
might get burned later:

http://wiki.apache.org/couchdb/HTTP_B...with_Bulk_Updates

On Jun 2, 2010 2:38 AM, "Aun... ???????"
<hello### @windowslive.com> wrote:



  Hi ,

       I delete a lot of documents and it failed on some point.
       How to design such things for atomic transaction ?


 Regards,
 Aun.


Atomic Delete Document

   Hi ,
 
        I delete a lot of documents and it failed on some point.
        How to design such things for atomic transaction ?


  Regards,
  Aun.
 		 	   		  

putting the 'document' back into document/literal
I find myself looking at creating a service where I want a return
value which is, in fact, an XML document. I don't want any binding, I
don't even want a DOM tree. Essentially, I want an MTOM binding on a
byte[] of XML so that I can do whatever I need to do with it. (As it
happens, I'm sticking my toe into RDF).

Just declare byte[] and use the usual MTOM setup technique?


list of structure..
Hello everybody!

We have puppet infrastructure integrated with ldap. I can pass
different variables via puppetVars attribute in ldap.
Currently, I need to write puppet class to configure mod_proxy server.
mod_proxy servers has 5-10 configured sites. Every site configuration
has some variables: site name, listen port, destination site name,
destination port, protocol..
Does anybody has an idea, how can I place all this variables out of
puppet classes? In ldap? Or maybe puppet have some internal database,
like chef?





Erlang Doc structure
I've been playing with Erlang views on and off in CouchDB, and find the
information on the internal Erlang structure of Docs lacking. Is there
somewhere I can read up on this? I had initially assumed that a Doc was a
list of tuples, but I am starting to suspect that I am wrong.

Mike

JMS-MAP-JSON Improper Data structure
I am getting an odd error in my data from my broker. Using perl I am
changing
a map message to json using jms-map-json. This returns an improperly
structured version of my data.



'map' => [
                     {
                       'entry' => [
                                    {
                                      'string' => [

As you can see it is creating an array where the hash should be.

I now have to access data like @{@{$json->{map}}[0]->{entry}}; Which
is very
unpleasant. We did not have this issue prior. I used to be able to simply
do

@{$json->{map}{entry}} to access my data


This is with amq 5.3.2




arbitrary structure for joins redux
Hi,
I recently discovered the new feature added in couchdb 0.11 which lets to
link related documents in the emit function by passing the _id value of a
given doc like it's explained in
http://blog.couch.io/post/446015664/w...11-part-two-views
I find this feature quite useful, but I would like to know if its planned
to
let use an arbitrary structure as the value for the emit function which
could contain several _id's references like emit(key, {title:"lorem
ipsum",
foo:{_id : "foo"}, bar : {_id : "bar"}})
so there could be linked more than one document with a single emit call. a
possible solution could probably be to call the emit function several
times
but then include_docs parameter could not be used when a reduce function
is
defined.

Thanks in advance

Regards




Need advice about docs structure design.
Hy guy's.

My model:
Users has
  Bookmarks and Posts

have idea keep Bookmarks and Posts in separate DB (for speed views).
But in view i want fetch Bookmarks and Posts with user name,

In what way i can do this?
keep copy of users in each DB?

or may be keep users in separate DB, fetch bookmarks or posts and then
fetch users and then merge?

Yes i know i can copy user name to doc, but have a trouble when user
name is changed (it's force me use stale=ok in request view
+background process to track changes and run rebuild index).

I think it's will be cool crazy stuff if i can update docs(cached
fields - not have effect to index) and say Couch you don't need
rebuild index relax ;).

Any advice?


adding request structure access to mod_header
We were dancing around trying to get RequestHeader (mod_header) to add
the authenticated user to a proxy request. The approaches we found
involved tricking other modules into calling ap_add_common_vars to
  apr_table_addn(r->subprocess_env, "REMOTE_USER", r->user);

I decided to simplify by adding %{}r directives à la
  RequestHeader set "x-webobjects-remote-user" "%{user}r"
which interrogate the request structure directly. I re-used
the request structure names 'cause, well, why not?


Please try to Cc: <er### @w3.org>. <eric### @gmail.com> is a
temporary
hack as ezmlm seems to subscribe the address in the Return-Path:
instead of the From:




adding request structure access to mod_header
We were dancing around trying to get RequestHeader (mod_header) to add
the authenticated user to a proxy request. The approaches we found
involved tricking other modules into calling ap_add_common_vars to
  apr_table_addn(r->subprocess_env, "REMOTE_USER", r->user);

I decided to simplify by adding %{}r directives à la
  RequestHeader set "x-webobjects-remote-user" "%{user}r"
which interrogate the request structure directly. I re-used
the request structure names 'cause, well, why not?


Please try to reply to <er### @w3.org>. <eri### @gmail.com> is a
temporary hack as ezmlm seems to subscribe the address in the
Return-Path: instead of the From: (grr!).



select whole tree
I looked: http://www.mongodb.org/display/DOCS/Trees in MongoDB
I chose "Array of Ancestors" scheme of tree. But I can't understand
how may I get whole tree in a single query?





JAXB tree for spec dds
While trying to figure out how to get geronimo and openejb to cooperate
better building jndi trees I spent  couple days converting geronimo to use
openejb's openejb-jee jaxb tree for spec dds.  AFAICT it works as well as
the xmlbeans tree and is a lot easier to work with.  It brings the
conflicts between geronimo and openejb into clearer focus for me, and
currently this is resulting in more tck failures.  However I think I will
be able to come up with a good solution for building the jndi tree now.

If there are no objections I'd like to clean this up a little bit and
commit it tomorrow.

thanks
david jencks



Tree Search in Cassandra
I'm still thinking about the problem of how to handle range queries on very
large sets of data, using Random Partitioning.

Has anyone used tree search to solve this? What do you think?

More specifically, something like this:

- Store a maximum of 1000 values per supercolumn (or some other fixed
number)
- Each supercolumn has a "greaterChild" and a "lessChild" in addition to
the
values
- When the number of values in the supercolumn grows beyond the maximum,
split it into 3 parts, with the top third going into "greaterChild" and
the
bottom third into "lessChild"
- To find a value, look at "greaterChild" and "lessChild" to find out
whether your key is within the current range, and if not, where to look
next
- Range searches mean finding the first value, then looking at
"greaterChild" or "lessChild" (depending on the direction of your search)
until you reach the end of the range.

Super Column Family:

index [ <columnFamilyId> [ "firstVal" : <val> ,
                           "lastVal" : <val> ,
                           <val> : <dataId>,
                           "lessChild" : <columnFamilyId> ,
                           "greaterChild" : <columnFamilyId> ]