# Query an Element

## In a Document

### For a Single Type

@snippet api/bsoncxx/examples/bson_documents/elements/doc_single.cpp Example

### For Multiple Types

@snippet api/bsoncxx/examples/bson_documents/elements/doc_multi.cpp Example

## In an Array

### For Single Type

@snippet api/bsoncxx/examples/bson_documents/elements/arr_single.cpp Example

### For Multiple Types

@snippet api/bsoncxx/examples/bson_documents/elements/arr_multi.cpp Example

## Comparison

### By Type

@snippet api/bsoncxx/examples/bson_documents/elements/cmp_type.cpp Example

### By BSON Value

@snippet api/bsoncxx/examples/bson_documents/elements/cmp_bson_value.cpp Example
