GraphQL Filter in Json Data

Hi Sebastian,

I have a json data(EditorJS) and I want to filter it. but it does not produce results. The result is blank.

My Graphql Filter: {documents:queryDocumentsContents(filter:“contains(data/value/en/blocks/data/content, ‘max’)”){id}}

can you help me with this?

{
  "data": {
    "queryDocumentsContents": [
      {
        "flatData": {
          "value": {
            "time": 1643970436341,
            "blocks": [
              {
                "id": "gWOo4y7_aX",
                "type": "table",
                "data": {
                  "withHeadings": false,
                  "content": [
                    [
                      "<b>Subtag&nbsp; &nbsp;</b>",
                      "<b>Max Size</b>",
                      "<b>Data Writing Format</b>",
                      "<b>Explanation and notes</b>"
                    ],
                    [
                      "&lt;Type&gt;",
                      "32 bytes",
                      "Alphanumeric",
                      "This is the field where the Transaction Type is sent. Details about the transaction types will be given separately in the document. Attention should be paid to the use of other fields according to the transaction type."
                    ],
                    [
                      "&lt;Count&gt;",
                      "",
                      "Alphanumeric",
                      "Total number of transactions will be displayed in this field."
                    ],
                    [
                      "&lt;CurrencyCode&gt;",
                      "3 bytes",
                      "Alphanumeric",
                      "The currency value will be displayed in this field."
                    ],
                    [
                      "&lt;Amount&gt;",
                      "17.2 numbers",
                      "Alphanumeric",
                      "Total transaction amount will be displayed in this field.&nbsp;"
                    ]
                  ]
                }
              }
            ],
            "version": "2.22.2"
          }
        }
      }
]
}

It looks like blocks is a reference right? It is not possible to filter by reference

Not reference field.

value:


Json Field (EditorJS) ( scripts/editor-editorjs.html )

blocks > data > content (EditorJS table component data)

https://editorjs.io/ please check it.

I see, I am not sure if MongoDB can handle this double array.

there are some examples maybe it will work for us


Yes, perhaps. But a lot of people say: Use another structure :wink:

You could use a string field instead or you create a searchable structure in your content editor.

It is not possible for me to change the output of EditorJS. For this reason, I need to make the in array searchable even though there is a array in it.