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
patternstringThe regex pattern for the property.
bsonTypeBsonTypeThe BSON type of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?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
patternstringThe regex pattern for the property.
bsonTypesIEnumerable<BsonType>The BSON types of the property.
algorithmEncryptionAlgorithm?The encryption algorithm to use.
keyIdGuid?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
pathExpression<Func<TDocument, TField>>The field.
configureAction<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe 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
pathFieldDefinition<TDocument>The field.
configureAction<EncryptedCollectionBuilder<TField>>An action to configure the nested builder.
Returns
- EncryptedCollectionBuilder<TDocument>
The current EncryptedCollectionBuilder<TDocument> instance.
Type Parameters
TFieldThe type of the nested field.