Код: Выделить всё
MongoЯ есть Попытка получить подсчет поля диапазона дат. Когда я даю дату дата от и до от RestClient я получаю счет как 0, за исключением, говоря:
Код: Выделить всё
org.bson.json.JsonParseException: JSON reader expected a string but found '?0'.
Код: Выделить всё
public interface PaymentMongoLogDetailRepository extends MongoRepository
{
@Query(value = "{'$and' : [{'createdOn':{'$gt':ISODate(?0)}},{'createdOn':{'$lte':ISODate(?1)}},{'stripeResponse.sessionId':/cs_live/},{'stripeResponse.status':'success'}]}",count = true)
Long findAllSuccessCounts(String from,String to);
}
Тот же запрос, когда я работаю в Mongo Shell дает мне не нулевые счета.
Код: Выделить всё
db.paymentMongoLogDetail.find({'$and' : [{'createdOn':{'$gt':ISODate('2025-01-24')}},{'createdOn':{'$lte':ISODate('2025-02-08')}},{'stripeResponse.sessionId':/cs_live/},{'stripeResponse.status':'success'}]}).count();
Код: Выделить всё
org.bson.json.JsonParseException: JSON reader expected a string but found '?0'.
Подробнее здесь: https://stackoverflow.com/questions/794 ... pring-boot