Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It does not work! #6

Open
ricrug opened this issue Feb 23, 2021 · 0 comments
Open

It does not work! #6

ricrug opened this issue Feb 23, 2021 · 0 comments

Comments

@ricrug
Copy link

ricrug commented Feb 23, 2021

Maybe nobody has ever tried it but... it doesn't work.
The attached examples don't work either... and a quick look at the code shows why:

    private String makeDBDoc(byte[] payload, String topic) {
      String msg = new String(payload);
      Document message = Document.parse(msg);
      Document doc = new Document();
      List<String> topicArr = Arrays.asList(topic.split("/"));
      Long unique_id = Long.parseLong(topicArr.get(21));
      Long quadkey = Long.parseLong(String.join("",topicArr.subList(2,20)));
      String now = ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT);
      Document dt = new Document();
      dt.put("$date",now);
      doc.put("message",message);
      doc.put("unique_id",unique_id);
      doc.put("quadkey",quadkey);
      doc.put("updateDate",dt);
      doc.put("pushed",false);
      return doc.toJson();
    }

with a code written in this way... with numbers thrown in this way... is it possible to have at least a description of the json that it interprets?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant