var view = _database.CreateAllDocumentsQuery();
var docs = view.Run().Select(x => new DatabaseUtils.CacheData
{
DescrName = (string) x.Document.Properties["name"],
Date = Convert.ToInt32(x.Document.Properties["date"]),
DescriptionType = Convert.ToInt32(x.Document.Properties["type"]),
Version = (string) x.Document.Properties["version"]
});
_iterator = docs.GetEnumerator();On Sep 1, 2014, at 1:33 AM, Sherry Ummen <sherry...@gmail.com> wrote:I have tried view. But for the first time it was soo dead slow. And I have this experience that view remain stale sometimes.
--To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/BF4CA051-4919-4EC5-B4BB-B7AA21E1EC73%40couchbase.com.
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/_-BKrLd7Fek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
Why do you need to test that the document ID is not null? Would it ever be null?
Why do you emit the document ID as the value in addition to the key? Why not just emit the document ID as the key and null as the value?
On Sep 1, 2014, at 7:21 PM, sherry...@gmail.com wrote:view.SetMapReduce((IDictionary<string, object> document, EmitDelegate emitter) => {if (document["_id"] != null) {emitter(document["_id"], document["_id"]);}
var view = _database.CreateAllDocumentsQuery();
var docs = view.Run().Select(x => new DatabaseUtils.CacheData
{
DescrName = (string) x.Document.Properties["name"],
Date = Convert.ToInt32(x.Document.Properties["date"]),
DescriptionType = Convert.ToInt32(x.Document.Properties["type"]),
Version = (string) x.Document.Properties["version"]
});
_iterator = docs.GetEnumerator();_database.CreateAllDocumentsQuery();
but the name of variable I choose is wrong. I kept it as "view" which probably cause the confusion.
And the view creation code which I posted earlier
view.SetMapReduce((_database.CreateAllDocumentsQuery(); its dead slow.
Just to give more info the database which I am querying has about 10000 documents and some of the document size is more than 90MB. Is that the reason of it being slow?
But what I wanted is just few properties of the document but not full document.
Once again sorry for the confusion.
On Sep 2, 2014, at 10:17 AM, Sherry Ummen <sherry...@gmail.com> wrote:Hmm ok then I should try with View but one thing I don understand how to emit multiple properties?
And regarding 90Mb data. Hmm yeah the data is huge I can't help it but hmm yeah I have been storing it like JSON data. Infact I can try using attachments.I am using couchdb with lite so that I can store huge data.
So that means attachment is treated somehow differently?