From 1ac268d409426e4aa2f10a8754d154d497750576 Mon Sep 17 00:00:00 2001 From: whn <142425816+Whning0513@users.noreply.github.com> Date: Fri, 28 Aug 2026 20:27:18 +0800 Subject: [PATCH] docs: correct to_bson complexity (#5334) Signed-off-by: whn <142425816+Whning0513@users.noreply.github.com> --- docs/mkdocs/docs/api/basic_json/to_bson.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/mkdocs/docs/api/basic_json/to_bson.md b/docs/mkdocs/docs/api/basic_json/to_bson.md index 6374d4c86..786fbc9e0 100644 --- a/docs/mkdocs/docs/api/basic_json/to_bson.md +++ b/docs/mkdocs/docs/api/basic_json/to_bson.md @@ -46,7 +46,9 @@ Strong guarantee: if an exception is thrown, there are no changes in the JSON va ## Complexity -Linear in the size of the JSON value `j`. +Proportional to the size of the JSON value `j` multiplied by its maximum nesting +depth, `O(n × d)`. BSON length prefixes are computed recursively before nested +values are written. ## Examples