Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"fields": [
{
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "prefixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
},
{
"queryType": "suffixPreview",
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"fields": [
{
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedText",
"bsonType": "string",
"queries": [
{
"queryType": "substringPreview",
"strMaxLength": {
"$numberInt": "10"
},
"strMinQueryLength": {
"$numberInt": "2"
},
"strMaxQueryLength": {
"$numberInt": "10"
},
"caseSensitive": true,
"diacriticSensitive": true
}
]
}
]
}
42 changes: 42 additions & 0 deletions src/mongocxx/include/mongocxx/v1/prefix_options-fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2009-present MongoDB, Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <mongocxx/config/prelude.hpp>

namespace mongocxx {
namespace v_noabi {
namespace options {

class prefix;

} // namespace options
} // namespace v_noabi
} // namespace mongocxx

namespace mongocxx {
namespace options {

using v_noabi::options::prefix;

} // namespace options
} // namespace mongocxx

#include <mongocxx/config/postlude.hpp>

///
/// @file
/// Declares @ref mongocxx::v_noabi::options::prefix.
///
81 changes: 81 additions & 0 deletions src/mongocxx/include/mongocxx/v1/prefix_options.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// Copyright 2009-present MongoDB, Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <mongocxx/options/prefix-fwd.hpp> // IWYU pragma: export

//

#include <bsoncxx/stdx/optional.hpp>

#include <mongocxx/config/prelude.hpp>

namespace mongocxx {
namespace v_noabi {
namespace options {

///
/// Used by @ref mongocxx::v_noabi::options::encrypt::text_opts.
///
/// Specifies index options (`RangeOpts`) for a Queryable Encryption field supporting "textPreview"
/// queries.
///
/// @note `caseSensitive`, `diacriticSensitive`, `prefix`, `suffix`, and `substring` must match the values set in the
/// encryptedFields of the destination collection.
///
class prefix {
public:
///
/// Default initialization.
///
prefix() = default;

/// @brief Sets `PrefixOpts.strMaxQueryLength`
prefix& str_max_query_length(int32_t value) {
_max_query_length = value;
return *this;
}

/// @brief Gets `PrefixOpts.strMaxQueryLength`
bsoncxx::v_noabi::stdx::optional<int32_t> const& str_max_query_length() const {
return _max_query_length;
}

/// @brief Sets `PrefixOpts.strMinQueryLength`
prefix& str_min_query_length(int32_t value) {
_min_query_length = value;
return *this;
}

/// @brief Gets `PrefixOpts.strMinQueryLength`
bsoncxx::v_noabi::stdx::optional<int32_t> const& str_min_query_length() const {
return _min_query_length;
}

private:
bsoncxx::v_noabi::stdx::optional<int32_t> _min_query_length;
bsoncxx::v_noabi::stdx::optional<int32_t> _max_query_length;
};

} // namespace options
} // namespace v_noabi
} // namespace mongocxx

#include <mongocxx/config/postlude.hpp>

///
/// @file
/// Provides @ref mongocxx::v_noabi::options::prefix.
///
42 changes: 42 additions & 0 deletions src/mongocxx/include/mongocxx/v1/substring_options-fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2009-present MongoDB, Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <mongocxx/config/prelude.hpp>

namespace mongocxx {
namespace v_noabi {
namespace options {

class substring;

} // namespace options
} // namespace v_noabi
} // namespace mongocxx

namespace mongocxx {
namespace options {

using v_noabi::options::substring;

} // namespace options
} // namespace mongocxx

#include <mongocxx/config/postlude.hpp>

///
/// @file
/// Declares @ref mongocxx::v_noabi::options::substring.
///
93 changes: 93 additions & 0 deletions src/mongocxx/include/mongocxx/v1/substring_options.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Copyright 2009-present MongoDB, Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <mongocxx/options/substring-fwd.hpp> // IWYU pragma: export

//

#include <bsoncxx/stdx/optional.hpp>

#include <mongocxx/config/prelude.hpp>

namespace mongocxx {
namespace v_noabi {
namespace options {

///
/// Used by @ref mongocxx::v_noabi::options::encrypt::text_opts.
///
/// Specifies index options (`SubstringOpts`) for a Queryable Encryption field supporting "substringPreview"
/// queries.
///
/// @note `strMaxQueryLength`, `strMinQueryLength`, and `strMaxLength` must match the values set in the
/// encryptedFields of the destination collection.
///
class substring {
public:
///
/// Default initialization.
///
substring() = default;

/// @brief Sets `SubstringOpts.strMaxQueryLength`
substring& str_max_query_length(int32_t value) {
_max_query_length = value;
return *this;
}

/// @brief Gets `SubstringOpts.strMaxQueryLength`
bsoncxx::v_noabi::stdx::optional<int32_t> const& str_max_query_length() const {
return _max_query_length;
}

/// @brief Sets `SubstringOpts.strMinQueryLength`
substring& str_min_query_length(int32_t value) {
_min_query_length = value;
return *this;
}

/// @brief Gets `SubstringOpts.strMinQueryLength`
bsoncxx::v_noabi::stdx::optional<int32_t> const& str_min_query_length() const {
return _min_query_length;
}

/// @brief Sets `SubstringOpts.strMaxLength`
substring& str_max_length(int32_t value) {
_max_length = value;
return *this;
}

/// @brief Gets `substringOpts.strMaxLength`
bsoncxx::v_noabi::stdx::optional<int32_t> const& str_max_length() const {
return _max_length;
}

private:
bsoncxx::v_noabi::stdx::optional<int32_t> _min_query_length;
bsoncxx::v_noabi::stdx::optional<int32_t> _max_query_length;
bsoncxx::v_noabi::stdx::optional<int32_t> _max_length;
};

} // namespace options
} // namespace v_noabi
} // namespace mongocxx

#include <mongocxx/config/postlude.hpp>

///
/// @file
/// Provides @ref mongocxx::v_noabi::options::substring.
///
42 changes: 42 additions & 0 deletions src/mongocxx/include/mongocxx/v1/suffix_options-fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2009-present MongoDB, Inc.
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <mongocxx/config/prelude.hpp>

namespace mongocxx {
namespace v_noabi {
namespace options {

class suffix;

} // namespace options
} // namespace v_noabi
} // namespace mongocxx

namespace mongocxx {
namespace options {

using v_noabi::options::suffix;

} // namespace options
} // namespace mongocxx

#include <mongocxx/config/postlude.hpp>

///
/// @file
/// Declares @ref mongocxx::v_noabi::options::suffix
///
Loading