Class TextOptions

java.lang.Object
com.mongodb.client.model.vault.TextOptions

@Alpha(SERVER) public class TextOptions extends Object
Text options for a Queryable Encryption field that supports text queries.

Note: TextOptions is in Alpha and subject to backwards breaking changes.

Since:
5.6
MongoDB documentation
queryable encryption
Since server release
8.2
  • Constructor Details

    • TextOptions

      public TextOptions()
      Construct a new instance
  • Method Details

    • getCaseSensitive

      public boolean getCaseSensitive()
      Returns:
      true if text indexes for this field are case sensitive.
    • caseSensitive

      public TextOptions caseSensitive(boolean caseSensitive)
      Set case sensitivity
      Parameters:
      caseSensitive - true if text indexes are case sensitive
      Returns:
      this
    • getDiacriticSensitive

      public boolean getDiacriticSensitive()
      Returns:
      true if text indexes are diacritic sensitive
    • diacriticSensitive

      public TextOptions diacriticSensitive(boolean diacriticSensitive)
      Set diacritic sensitivity
      Parameters:
      diacriticSensitive - true if text indexes are diacritic sensitive
      Returns:
      this
    • prefixOptions

      public TextOptions prefixOptions(@Nullable org.bson.BsonDocument prefixOptions)
      Set the prefix options.

      Expected to be a BsonDocument in the format of:

       
         {
          // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
          strMinQueryLength: BsonInt32,
          // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
          strMaxQueryLength: BsonInt32
         }
       
       
      Parameters:
      prefixOptions - the prefix options or null
      Returns:
      this
    • getPrefixOptions

      @Nullable public org.bson.BsonDocument getPrefixOptions()
      Returns:
      the prefix options document or null
      See Also:
    • suffixOptions

      public TextOptions suffixOptions(@Nullable org.bson.BsonDocument suffixOptions)
      Set the suffix options.

      Expected to be a BsonDocument in the format of:

       
         {
          // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
          strMinQueryLength: BsonInt32,
          // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
          strMaxQueryLength: BsonInt32
         }
       
       
      Parameters:
      suffixOptions - the suffix options or null
      Returns:
      this
    • getSuffixOptions

      @Nullable public org.bson.BsonDocument getSuffixOptions()
      Returns:
      the suffix options document or null
      See Also:
    • substringOptions

      public TextOptions substringOptions(@Nullable org.bson.BsonDocument substringOptions)
      Set the substring options.

      Expected to be a BsonDocument in the format of:

       
         {
          // strMaxLength is the maximum allowed length to insert. Inserting longer strings will error.
          strMaxLength: BsonInt32,
          // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
          strMinQueryLength: BsonInt32,
          // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
          strMaxQueryLength: BsonInt32
         }
       
       
      Parameters:
      substringOptions - the substring options or null
      Returns:
      this
    • getSubstringOptions

      @Nullable public org.bson.BsonDocument getSubstringOptions()
      Returns:
      the substring options document or null
      See Also: