Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. JSONata in JS-Adapter 4.4.3

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    JSONata in JS-Adapter 4.4.3

    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rewenode last edited by

      Ich habe mit Interesse gesehen, dass ihr JSONata integriert habt. Gibt es da irgendwelche Wrapper-Funktionen oder wie ist es implementiert?

      1 Reply Last reply Reply Quote 0
      • V
        vollnormal last edited by

        Eigentlich müsste es unter "Convert" sein (https://github.com/ioBroker/ioBroker.javascript/blob/master/docs/de/blockly.md#convert-by-jsonata-expression). Ich suche es auch vergeblich. Vlt. machen wir aber auch was falsch 👼

        R 1 Reply Last reply Reply Quote 0
        • R
          rewenode @vollnormal last edited by rewenode

          @vollnormal sagte in JSONata in JS-Adapter 4.4.3:

          Vlt. machen wir aber auch was falsch

          Keine Ahnung. Sollte eigentlich unter "Konvertierung" in Blockly zu finden sein. Ist es aber nicht. Da ich Blockly ansonsten nicht verwende, habe ich nicht weiter gegraben.
          Aber natürlich kannst du JSONata nativ unter Javascript verwenden:

          var jsonata = require("jsonata");
          
          var data = {
            example: [
              {value: 4},
              {value: 7},
              {value: 13}
            ]
          };
          var expression = jsonata("$sum(example.value)");
          log(expression.evaluate(data));  // returns 24
          

          Da es dabei offenbar keine Rolle spielt, ob bei der Javascript-Instanz "jsonata" als npm-Paket angegeben wird, scheint es wohl global eingebunden zu sein.
          Für komplizierte Object-Abfragen/Manipulationen ist JSONata unschlagbar.

          p.s. Da auf meine ursprüngliche Frage keine Reaktion erfolgt ist, scheint es wohl noch nicht endgültig implementiert zu sein, oder @klein0 schaut hier nicht so oft vorbei;-)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          539
          Online

          31.8k
          Users

          80.0k
          Topics

          1.3m
          Posts

          2
          3
          1451
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo