func (a *ArrayBuilder) AppendBoolean(b bool) *ArrayBuilder {
	a.arr = AppendBooleanElement(a.arr, a.incrementKey(), b)
	return a
}
AppendBoolean will append a boolean element using b to a.arr
package bsoncore
import (
	"strconv"
	"go.mongodb.org/mongo-driver/bson/bsontype"
	"go.mongodb.org/mongo-driver/bson/primitive"
)
type ArrayBuilder struct {
	arr     []byte
	indexes []int32
	keys    []int
}
func NewArrayBuilder() *ArrayBuilder {
	return (&ArrayBuilder{}).startArray()
}
func (a *ArrayBuilder) startArray() *ArrayBuilder {
	var index int32
	index, a.arr = AppendArrayStart(a.arr)
	a.indexes = append(a.indexes, index)
	a.keys = append(a.keys, 0)
	return a
}
func (a *ArrayBuilder) Build() Array {
	lastIndex := len(a.indexes) - 1
	lastKey := len(a.keys) - 1
	a.arr, _ = AppendArrayEnd(a.arr, a.indexes[lastIndex])
	a.indexes = a.indexes[:lastIndex]
	a.keys = a.keys[:lastKey]
	return a.arr
}
func (a *ArrayBuilder) incrementKey() string {
	idx := len(a.keys) - 1
	key := strconv.Itoa(a.keys[idx])
	a.keys[idx]++
	return key
}
func (a *ArrayBuilder) AppendInt32(i32 int32) *ArrayBuilder {
	a.arr = AppendInt32Element(a.arr, a.incrementKey(), i32)
	return a
}
func (a *ArrayBuilder) AppendDocument(doc []byte) *ArrayBuilder {
	a.arr = AppendDocumentElement(a.arr, a.incrementKey(), doc)
	return a
}
func (a *ArrayBuilder) AppendArray(arr []byte) *ArrayBuilder {
	a.arr = AppendArrayElement(a.arr, a.incrementKey(), arr)
	return a
}
func (a *ArrayBuilder) AppendDouble(f float64) *ArrayBuilder {
	a.arr = AppendDoubleElement(a.arr, a.incrementKey(), f)
	return a
}
func (a *ArrayBuilder) AppendString(str string) *ArrayBuilder {
	a.arr = AppendStringElement(a.arr, a.incrementKey(), str)
	return a
}
func (a *ArrayBuilder) AppendObjectID(oid primitive.ObjectID) *ArrayBuilder {
	a.arr = AppendObjectIDElement(a.arr, a.incrementKey(), oid)
	return a
}
func (a *ArrayBuilder) AppendBinary(subtype byte, b []byte) *ArrayBuilder {
	a.arr = AppendBinaryElement(a.arr, a.incrementKey(), subtype, b)
	return a
}
func (a *ArrayBuilder) AppendUndefined() *ArrayBuilder {
	a.arr = AppendUndefinedElement(a.arr, a.incrementKey())
	return a
}