Package org.springframework.data.mongodb.core.index

Examples of org.springframework.data.mongodb.core.index.Index.sparse()


  }

  @Test
  public void testWithSparse() {
    Index i = new Index().on("name", Direction.ASC);
    i.sparse().unique();
    assertEquals("{ \"name\" : 1}", i.getIndexKeys().toString());
    assertEquals("{ \"unique\" : true , \"sparse\" : true}", i.getIndexOptions().toString());
  }

  @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.