Multiple keys and multiple values

21 views
Skip to first unread message

Julio Albuquerque

unread,
Jan 20, 2015, 3:19:51 PM1/20/15
to mobile-c...@googlegroups.com
Hi.
I'm using Xamarin Studio, Xamarin Android and CouchbaseLite .Net.
How do I use more than one key in creating views and issue more than one value?
Within this platform I use C # .Net.

            var vwrestaurantes = database.GetView ("restaurantes");

            vwrestaurantes
.SetMap ((document, emitter) => {
                 
if ((document ["blativo"].ToString () == "1") && (document ["tipo"].ToString () == "E")) {

                     
emitter (document["nome"], document ["nome"]);
                 
}
             
}, "1");
             
var qry = vwrestaurantes.CreateQuery ();
 
             
var lines = qry.Run ();
In emiiter I need to put more values in the emitter parameters (key, value).
How to do it?
I've tried: emitter ([key1, key2], [value1, value2]) but does not work.
Can anyone help?


Jens Alfke

unread,
Jan 20, 2015, 3:24:57 PM1/20/15
to mobile-c...@googlegroups.com

On Jan 20, 2015, at 12:19 PM, Julio Albuquerque <jcezar.al...@gmail.com> wrote:

In emiiter I need to put more values in the emitter parameters (key, value).
How to do it?

Just call emit() more than once!

—Jens
Reply all
Reply to author
Forward
0 new messages