Method PatternProperty
- Namespace
- MongoDB.Driver.Encryption
- Assembly
- MongoDB.Driver.Encryption.dll
PatternProperty(string, BsonType, EncryptionAlgorithm?, Guid?)
Adds a pattern property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> PatternProperty(string pattern, BsonType bsonType, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
pattern
stringThe regex pattern for the property.
bsonType
BsonTypeThe BSON type of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
PatternProperty(string, IEnumerable<BsonType>, EncryptionAlgorithm?, Guid?)
Adds a pattern property to the schema with encryption settings.
public EncryptedCollectionBuilder<TDocument> PatternProperty(string pattern, IEnumerable<BsonType> bsonTypes = null, EncryptionAlgorithm? algorithm = null, Guid? keyId = null)
Parameters
pattern
stringThe regex pattern for the property.
bsonTypes
IEnumerable<BsonType>The BSON types of the property.
algorithm
EncryptionAlgorithm?The encryption algorithm to use.
keyId
Guid?The key ID to use for encryption.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
PatternProperty<TField>(Expression<Func<TDocument, TField>>, Action<EncryptedCollectionBuilder<TField>>)
Adds a nested pattern property to the schema.
public EncryptedCollectionBuilder<TDocument> PatternProperty<TField>(Expression<Func<TDocument, TField>> path, Action<EncryptedCollectionBuilder<TField>> configure)
Parameters
path
Expression<Func<TDocument, TField>>The field.
configure
Action<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the nested field.
PatternProperty<TField>(FieldDefinition<TDocument>, Action<EncryptedCollectionBuilder<TField>>)
Adds a nested pattern property to the schema.
public EncryptedCollectionBuilder<TDocument> PatternProperty<TField>(FieldDefinition<TDocument> path, Action<EncryptedCollectionBuilder<TField>> configure)
Parameters
path
FieldDefinition<TDocument>The field.
configure
Action<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TField
The type of the nested field.