Busqueda entre Fechas filterBetweenDate()/filterBetweenDateWithoutHours()
Cuando necesitamos buscar entre fechas utilizamos el método filterBetweenDate()
Permiten buscar entre fechas de inicio y fin
Los mètodos que contienen WithoutHour asigan internamente la hora en 0 de la fecha de inicio y la hora en 23 de la fecha final.
Método | Descripción | Aplica |
public List<T> filterBetweenDate(String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | Busca en toda la colección filtrando por el rango de fechas. | solo fechas sin horas |
public List<T> filterBetweenDatePagination(String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) { | Busca en rango de fechas con paginación | solo fechas sin horas |
List<T> filterBetweenDate(String secondaryfield,String secondaryfieldvalue,String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | Filtra en un rango de fechas e incluye una condiciòn and en el filtro para buscar por otro campo sin paginaciòn. Ejemplo buscar de todos los idagente =14 y fecha entre el 1 y 28 de enero de 2018. | solo fechas sin horas |
List<T> filterBetweenDatePagination(String secondaryfield,String secondaryfieldvalue,String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra en un rango de fechas con paginaciòn e incluye un filtro and adicional. | solo fechas sin horas |
List<T> filterBetweenDate(String secondaryfield, Integer secondaryfieldvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | Filtra por un rango de fechas, con un filtro inicial en base un atributo entero. | solo fechas sin horas |
List<T> filterBetweenDate(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | El primer parámetro es un filtro compuesto y los siguientes parámetros son los atributos con las fechas. | solo fechas sin horas |
List<T> filterBetweenDateOR(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | Utiliza condición Or donde busca por el primer filtro o por el rango de fechas. | solo fechas sin horas |
List<T> filterBetweenDatePagination(String secondaryfield, Integer secondaryfieldvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra por un rango de fechas y un parámetro con paginacion | solo fechas sin horas |
List<T> filterBetweenDatePagination(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Un filtro como parámetro y las fechas iniciales y finales con paginaciòn. | solo fechas sin horas |
List<T> filterBetweenDatePaginationOR(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Se cumple el Bson myfilter o el filtro entre fechas con paginaciòn. | solo fechas sin horas |
public List<T> filterBetweenDateWithoutHours(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) { | Filtra entre dos fechas asignando internamente la hora inicial en cero y la hora final en 23. Y Aplica un AND con myfilter· | fechas con horas |
List<T> filterBetweenDateWithoutHoursOR(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. y aplica la condicion OR con myfilter | fechas con horas |
List<T> filterBetweenDatePaginationWithoutHours(String secondaryfield, String secondaryfieldvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | fechas con horas |
List<T>filterBetweenDatePaginationWithoutHours(String secondaryfield, Integer secondaryfieldvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | |
List filterBetweenDatePaginationWithoutHours(String secondaryfield, String secondaryfieldvalue,String thirdfield, String thirdvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) { | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | |
List filterBetweenDatePaginationWithoutHours(String secondaryfield,String secondaryfieldvalue,String thirdfield, Integer thirdvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) { | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | |
List<T> filterBetweenDatePaginationWithoutHours(String integerFieldName,Integer integerFieldValue,String integerFieldName2, Integer integerFieldValue2, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | |
List<T> filterBetweenDatePaginationWithoutHours(String secondaryfield,Integer secondaryfieldvalue,String thirdfield, String thirdvalue, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. | |
List<T> filterBetweenDatePaginationWithoutHours(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. Aplica un AND con myfilter. | fechas con horas |
List<T> filterBetweenDatePaginationWithoutHoursOR(Bson myfilter, String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Integer pageNumber, Integer rowsForPage, Document... docSort) | Filtra entre fechas asignando la hora inicial a 0 a la hora inicial y la hora en 23 a la fecha final. Aplica un OR con myfilter. | fechas con horas |
Bson createBsonBetweenDateWithoutHours(String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue, Document... docSort) { | Crea un filtro de tipo BSON entre fechas sin tomar en cuenta las horas. | devuelve BSON |
Bson createBsonBetweenDateUsingHours(String fieldnamestart, Date datestartvalue, String fieldlimitname, Date datelimitvalue) { | Crea un filtro BSON entre fechas tomandoen cuenta las horas, | devuelve BSON |
parametro | |
fieldnamestart | nombre del atributo de fecha inicial |
datestartvalue | valor de la fecha inicial |
fieldlimitname | nombre del atributo de fecha final |
datelimitvalue | valor de la fecha final |
Document...docSort | Ordenaciòn |
Bson myfilter | Filtro usado para combinaciones con las fechas. |
Filtrando entre rango de fechas y un filtro por el idagente
Si no deseamos usar el mètodo filterBetweenDate(), podemos hacerlo de la forma tradicional, creando un filtro y luego invocando al mètodo filters del repository.
Crear filtros usando createBsonBetweenDateWithoutHours
Last updated