Sign In Register

How can we help you today?

Start a new topic

How to query arrays using DataTypes

hi,


I have a simple data type, like in the Hearthstone example, called "playerDeck".


The json looks like this:


   

{
  "decks": {
    "startingDeck": [
      "warrior",
      "mage",
      "archer"
    ]
  },
  "currentDeck": "startingDeck"
}

 

And I have another entry like this:

 

{
  "decks": {
    "startingDeck": [
      "warrior",
      "mage",
      "archer"
    ],
    "SomeOtherDeck": [
      "foo",
      "archer",
      "baz"
    ]
  },
  "currentDeck": "SomeOtherDeck"
}

 

  

I have an index created on "decks.StartingDeck" path. I want to search inside the array to find all entries which contain a card called "mage".

The problem is, based on the documentation I've read, arrays only get searched on the LAST item in the array.

This seems pretty useless to be honest. What happens if I want to find all decks which contain the "mage" card?

Is there some way to write a query which will check the entire contents of the array?


Thank you for your support!


1 person has this question
1 Comment

Hi Drew,


have you managed to get what you needed working?

Login to post a comment