-1

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqu08dsyxz98whc is one out of possibly many tx which have whc substring in output address,

https://blockchair.com/bitcoin-cash/transaction/ce4b6388c3b57dc188bfafde87d7af28ee3ba210d0a3223a3bc86f6083337459

I would like to find such outputs for 2018-08 using bitdb query lang similar to mongodb,

{
  "v": 3,
  "q": {
    "find": {
      "out.e.a": { "$regex": "whc$" },
      "blk.t": {
        "$gte": "2018-08-01T00:00:00Z",
        "$lte": "2018-08-31T00:00:00Z"
      }
    },
    "limit": 1
  }
}

Unfortunately I'm not getting any result for such query Is there some syntax issue which prevents correct results?

mpapec
  • 50,217
  • 8
  • 67
  • 127
  • 1
    This seems `bitdb` specific ( noting that you just created the tag for this question ). I suspect at a glance though that the "dates" might be the issue here, and I don't see any example in the documentation showing date based queries. Possibly related to BSON Dates vs "strings", so showing a sample document ( or truncated to the relevant fields and data at least ) would actually gain you a wider audience – Neil Lunn Nov 06 '18 at 21:32

1 Answers1

0

Try to query using Unix timestamps instead of ISO Dates. To convert from ISO Date to unix timestamp in javascript you can do:

var myDate = new Date(ISODate("2015-10-25T00:00:00.000Z"));
var myTimeStamp = myDate.getTime() / 1000;
EvaMay
  • 84
  • 5