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

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


   */
  public void onCreation(PartTreeMongoQuery query) {

    PartTree tree = query.getTree();
    Index index = new Index();
    index.named(query.getQueryMethod().getName());
    Sort sort = tree.getSort();

    for (Part part : tree.getParts()) {
      if (GEOSPATIAL_TYPES.contains(part.getType())) {
        return;
View Full Code Here


  }

  @Test
  public void testNamedMultiFieldUniqueIndex() {
    Index i = new Index().on("name", Direction.ASC).on("age", Direction.DESC);
    i.named("test").unique();
    assertEquals("{ \"name\" : 1 , \"age\" : -1}", i.getIndexKeys().toString());
    assertEquals("{ \"name\" : \"test\" , \"unique\" : 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.