Skip to content

Commit

Permalink
Update basics.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Jun 5, 2024
1 parent 3964f3e commit 66eec5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ support for users who avoid exceptions. See [the simdjson error handling documen
auto json = R"( { "test":{ "val1":1, "val2":2 } } )"_padded;
auto doc = parser.iterate(json);
size_t count = doc.count_fields(); // requires simdjson 1.0 or better
std::cout << "Number of fields: " << new_count << std::endl; // Prints "Number of fields: 1"
std::cout << "Number of fields: " << count << std::endl; // Prints "Number of fields: 1"
```
Similarly to `count_elements`, you should not let an object instance go out of scope before consuming it after calling
the `count_fields` method. If you access an object inside a document, you can use the `count_fields` method as follow.
Expand Down

0 comments on commit 66eec5f

Please sign in to comment.