Querying views with multiple parameters leaving some blank

I’m trying to query the following view:

function (doc, meta) {
if(doc.theCollection==“personal_record”) {
emit([doc.userId,doc.torusId,doc.score,doc.nMoves,doc.packId,doc.userName], null);

I’d query based on range and fixing only the first two parameters like this:
startKey = [“myuserId”,“myTorusId”,0,0,"",""] endKey =[“myuserId”,“myTorusId”,999,999,"~","~"]
but the view returns nothing, when I know at least a document starting with these keys exists
what am I missing in passing start and end keys?

Hi @mikbin80,

I created a single document:

  "nMoves": 0,
  "packId": "",
  "score": 0,
  "torusId": "myTorusId",
  "userId": "myuserId",
  "userName": ""

Then I added some filtering:



I got a result:


Am I doing something different than you?

Hi Matthew,
thanks for your help.
I think I’m misunderstaing some sorting with strings in javascript.
I’ve tested a view with 4 parameters and it works, so I think I’m just messing up thinks with that collection.
thanks again

1 Like