Search not working?

Issue #9 new
Tom Krones created an issue

Hello. I'm trying out the app and am very happy with it so far but I feel like the search isn't working right. I'm not sure if this is a bug or just me using it wrong.

I put this into the search bar above my JSON object:

$.*.ingredients[@.ingredient = 'egg']

Here's a link to the file am testing on:

https://expirebox.com/download/5924a7f6016db47a4853045d6a7d18c1.html

Note: that's a temporary link. The file needs to be downloaded in 2 days.

Comments (3)

  1. Tom Krones reporter

    Here's the json

    {
      "Tomato Basil Frittata": {
        "key": "Tomato Basil Frittata",
        "serves": 6,
        "ingredients": [
          {
            "amount": 12,
            "unit": "",
            "ingredient": "egg",
            "perishable": false,
            "process": ""
          },
          {
            "amount": 1,
            "unit": "",
            "ingredient": "egg",
            "perishable": false,
            "process": ""
          },
          {
            "amount": 0.25,
            "unit": "tsp",
            "ingredient": "Pepper",
            "perishable": true,
            "process": ""
          },
          {
            "amount": 0.5,
            "unit": "cup",
            "ingredient": "almond meal",
            "perishable": false,
            "process": ""
          }
        ],
        "method": [
          "Heat almond meal, flax, liquid, coconut, and cinnamon in a microwave-safe container; heat for one minute.",
          "Stir to mix in egg, then heat for another 45-60 seconds until set to your liking.",
          "Step 3",
          "Step 4"
        ],
        "image": "Tomato Basil Frittata",
        "isFree": true,
        "SmartArray": [
    
        ]
      },
      "Tomato Basil Frittata2": {
        "key": "Tomato Basil Frittata",
        "serves": 6,
        "ingredients": [
          {
            "amount": 12,
            "unit": "",
            "ingredient": "egg",
            "perishable": false,
            "process": ""
          },
          {
            "amount": 1,
            "unit": "",
            "ingredient": "egg",
            "perishable": false,
            "process": ""
          },
          {
            "amount": 0.25,
            "unit": "tsp",
            "ingredient": "Pepper",
            "perishable": true,
            "process": ""
          },
          {
            "amount": 0.5,
            "unit": "cup",
            "ingredient": "almond meal",
            "perishable": false,
            "process": ""
          }
        ],
        "method": [
          "Heat almond meal, flax, liquid, coconut, and cinnamon in a microwave-safe container; heat for one minute.",
          "Stir to mix in egg, then heat for another 45-60 seconds until set to your liking.",
          "Step 3",
          "Step 4"
        ],
        "image": "Tomato Basil Frittata",
        "isFree": true,
        "SmartArray": [
    
        ]
      }
    }
    
  2. Jan Kubny repo owner

    Hello

    I have looked at this issue, and it is a bug. Currently the query will not execute correctly unless you remove the '' signs around the string value that is a bug.

    The query will return results if it is written as : $.*.ingredients[?(@.ingredient == egg)]

    the correct query is

    $.*.ingredients[?(@.ingredient == 'egg')]

    there is some bug involving the ''.

    This is a bug and I am going to fix it.

    Thank you.

  3. Log in to comment