// Copyright (C) MongoDB, Inc. 2017-present. // // Licensed under the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 package bson // node is a compact representation of an element within a BSON document. // The first 4 bytes are where the element starts in an underlying []byte. The // last 4 bytes are where the value for that element begins. // // The type of the element can be accessed as `data[n[0]]`. The key of the // element can be accessed as `data[n[0]+1:n[1]-1]`. This will account for the // null byte at the end of the c-style string. The value can be accessed as // `data[n[1]:]`. Since there is no value end byte, an unvalidated document // could result in parsing errors. type node [2]uint32