Hi Jens. I did it!!, my script works without damaging the documents, not too fast, but decreased document size
Here is the gist: https://gist.github.com/razorblade446/b2e9c3d96adf7c8eb82d If you could give me your opinion, will be great!!! El lunes, 20 de abril de 2015, 20:34:07 (UTC-5), Frederic Yesid Peña Sánchez escribió: > > Hi Jens > > I'm not planning on modifying the SG code, i'm modifying the docs directly > with a tiny script made in PHP. > > I took measures in case of errors, and made backups of every document > before modifiying them. > > I'm studying the specs you told me about revsTree and MarshalJSON. > > I'm not ever "knowful" of go, so i prefer to use php api. > > I'll tell you how i'm doing, without asking you about errors. ;) > > 2015-04-20 18:55 GMT-05:00 Jens Alfke <[email protected]>: > >> >> On Apr 20, 2015, at 12:28 PM, Frederic Yesid Peña Sánchez < >> [email protected]> wrote: >> >> So the issue here is that the "revision" info, that "list" of revisions >> is getting too long (and not that the document itself is holding a lot of >> revisions), and that may be collapsing my DB, so i'ts safe to trim that >> revision tree?? cut from 1000 lines to 20 for example?? >> >> >> Unless there are conflicts, it shouldn’t be getting longer than >> the RevsLimit configured for the database. Did you edit your configuration >> to set a lower RevsLimit? (And note that the change doesn’t apply to a >> document until the next time it’s saved.) >> >> If i trim the revs, parents and deleted arrays at the same time, leaving >> the last 20 items, do this will trim my history tree?. >> >> >> No! This will just break the revision tree and cause Go panics when >> accessing the document. Please read the comments on the revTreeList struct >> in revtree.go. "Ordering in the arrays doesn't matter.” (It’s random, >> determined only by the order in which the hash table is enumerated.) >> >> It is possible to edit the JSON to trim old revisions, but it will take a >> good knowledge of the schema it’s written in. Hopefully the revTreeList >> struct and the MarshalJSON method have enough info to figure out the >> details. >> >> I don’t want to tell you not to hack on this :) but if you do so, you’re >> entering the territory of a SG developer. It would be great if you found >> bugs or inefficiencies in managing the rev tree, and even better if you >> sent us fixes, but *please* don’t do this to any database you plan to >> use in production. (Or if you do, don’t ask us for help with resulting >> problems because they’re going to be impossible for us to troubleshoot >> without understanding the changes you’ve made to the code…) >> >> —Jens >> >> -- >> 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/GnT4-qYJwgA/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/mobile-couchbase/48960EBA-CAF6-4DB4-90E8-94E051658C4C%40couchbase.com >> >> <https://groups.google.com/d/msgid/mobile-couchbase/48960EBA-CAF6-4DB4-90E8-94E051658C4C%40couchbase.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/b01db3d6-2113-478c-9822-6d6bad2c9ce7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
