Class IndexModel



  • public class IndexModel
    extends java.lang.Object
    A model describing the creation of a single index.
    Since:
    3.0
    MongoDB documentation
    Index options
    • Constructor Summary

      Constructors 
      Constructor Description
      IndexModel​(org.bson.conversions.Bson keys)
      Construct an instance with the given keys.
      IndexModel​(org.bson.conversions.Bson keys, IndexOptions options)
      Construct an instance with the given keys and options.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bson.conversions.Bson getKeys​()
      Gets the index keys.
      IndexOptions getOptions​()
      Gets the index options.
      java.lang.String toString​()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IndexModel

        public IndexModel​(org.bson.conversions.Bson keys)
        Construct an instance with the given keys.
        Parameters:
        keys - the index keys
      • IndexModel

        public IndexModel​(org.bson.conversions.Bson keys,
                          IndexOptions options)
        Construct an instance with the given keys and options.
        Parameters:
        keys - the index keys
        options - the index options
    • Method Detail

      • getKeys

        public org.bson.conversions.Bson getKeys​()
        Gets the index keys.
        Returns:
        the index keys
      • getOptions

        public IndexOptions getOptions​()
        Gets the index options.
        Returns:
        the index options
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object