Skip to content

where in the getDocuments query does not work for $createdAt field #2303

@owl352

Description

@owl352

I was sorting through the documents and noticed that there are fields that search fine, and there are fields that don't search fine

Expected Behavior

When I request all the documents for an address, I get the correct response with the correct number of documents

await this.client.platform.documents.get('withdrawal.withdrawal', {
  where: [
    ['$ownerId', '==', identifier],
  ],
  limit
})

Next, I looked at the $createdAt timestamp for one of the documents and I request with new data

const test = await this.client.platform.documents.get('withdrawal.withdrawal', {
  where: [
    ['$createdAt', '==', 1728505440651],
  ],
  limit
})

I should get 1 document in the response

Current Behavior

However, I end up with an empty array in the response

const docsResp = await this.client.platform.documents.get('withdrawal.withdrawal', {
  where: [
    ['$ownerId', '==', '8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc'],
  ],
  limit
})

const docs = docsResp.map(v=>v.toJSON())
const createdAt = docs[0].$createdAt

console.log(`Founded: ${docsResp.length}`)
console.log(`Documents: ${JSON.stringify(docs)}`)
console.log(`First timestamp for $createdAt: ${createdAt}`)

const docsRespByCreatedAt = await this.client.platform.documents.get('withdrawal.withdrawal', {
  where: [
    ['$createdAt', '==', createdAt],
  ],
  limit
})

console.log(`Founded in second response: ${docsRespByCreatedAt.length}`)
console.log(`Documents in second response: ${JSON.stringify(docsRespByCreatedAt)}`)
LOGS

> [email protected] start
> node index.js

Founded: 10
Documents: [{"$id":"H1BCmapp3m9xMU3x2RNweFndEs8QJ5v2ABAvUVBgVaaZ","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":200000,"coreFeePerByte":5,"outputScript":"dqkU9RRTpTjZoKn7P+DylIoPgNnPUlqIrA==","pooling":0,"status":3,"transactionIndex":24,"transactionSignHeight":1118602,"$revision":4,"$createdAt":1728505440651,"$updatedAt":1728554039974,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"HEdA6MspFcvDf7j6i7qidf9pdrVZK4x5pBu8NEB3VhTn","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":190000,"coreFeePerByte":5,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":22,"transactionSignHeight":1118602,"$revision":4,"$createdAt":1728500271509,"$updatedAt":1728554039974,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"J7Ff15VpiXaEv8A7xa6U5aq9WG9sN4iEQffThbi6wJSh","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":190000,"coreFeePerByte":5,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":23,"transactionSignHeight":1118602,"$revision":4,"$createdAt":1728500510399,"$updatedAt":1728554039974,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"2TEs6667q4fCKiGVondLr6D1rosXcvQoKGoXrsdtRzQb","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":400000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":37,"transactionSignHeight":1125193,"$revision":4,"$createdAt":1729431555604,"$updatedAt":1729495850491,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"ETgifEvB92dFtgsWQMBYz6HZJkb4QURYi2DAu86PndUw","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":400000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":39,"transactionSignHeight":1125193,"$revision":4,"$createdAt":1729489601467,"$updatedAt":1729495850491,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"FbA8r9scNa2n4YB3jkdHK1aaaURnGf5fmU1UAKvLLLhN","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":400000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":38,"transactionSignHeight":1125193,"$revision":4,"$createdAt":1729439223626,"$updatedAt":1729495850491,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"8AVaSJdHLBBMgYwmCHuqBXc5TeFMptGFZ7LM5prZ2Yq2","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":400000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":40,"transactionSignHeight":1126709,"$revision":4,"$createdAt":1729534066861,"$updatedAt":1729693354211,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"8DxrbdLMihzJu8c5VEvSMdm9nRCEiE6Tyc9nVQ9f5Pmg","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":4000000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":54,"transactionSignHeight":1127775,"$revision":4,"$createdAt":1729791480658,"$updatedAt":1729819436017,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"6ow45AvJ4jBdHxsCVUH1PGy1xEw9yg3hAC1jfohQ8ioG","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":4000000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":80,"transactionSignHeight":1131337,"$revision":4,"$createdAt":1730297997769,"$updatedAt":1730328609682,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"},{"$id":"E1FZpGixJSXmAwwEtCxqHpGM3XeFyFKLdNSCQMmzFJko","$ownerId":"8eTDkBhpQjHeqgbVeriwLeZr1tCa6yBGw76SckvD1cwc","amount":4000000,"coreFeePerByte":1,"outputScript":"dqkUT5vx/UWS1NGHPxErcfXG2a3sicmIrA==","pooling":0,"status":3,"transactionIndex":81,"transactionSignHeight":1131337,"$revision":4,"$createdAt":1730311760674,"$updatedAt":1730328609682,"$transferredAt":null,"$createdAtBlockHeight":null,"$updatedAtBlockHeight":null,"$transferredAtBlockHeight":null,"$createdAtCoreBlockHeight":null,"$updatedAtCoreBlockHeight":null,"$transferredAtCoreBlockHeight":null,"$dataContract":{"$format_version":"0","id":"4fJLR2GYTPFdomuTVvNy3VRrvWgvkKPzqehEBpNf2nk6","config":{"$format_version":"0","canBeDeleted":false,"readonly":false,"keepsHistory":false,"documentsKeepHistoryContractDefault":false,"documentsMutableContractDefault":true,"documentsCanBeDeletedContractDefault":true,"requiresIdentityEncryptionBoundedKey":null,"requiresIdentityDecryptionBoundedKey":null},"version":1,"ownerId":"11111111111111111111111111111111","schemaDefs":null,"documentSchemas":{"withdrawal":{"description":"Withdrawal document to track underlying withdrawal transactions. Withdrawals should be created with IdentityWithdrawalTransition","creationRestrictionMode":2,"type":"object","indices":[{"name":"identityStatus","properties":[{"$ownerId":"asc"},{"status":"asc"},{"$createdAt":"asc"}],"unique":false},{"name":"identityRecent","properties":[{"$ownerId":"asc"},{"$updatedAt":"asc"},{"status":"asc"}],"unique":false},{"name":"pooling","properties":[{"status":"asc"},{"pooling":"asc"},{"coreFeePerByte":"asc"},{"$updatedAt":"asc"}],"unique":false},{"name":"transaction","properties":[{"status":"asc"},{"transactionIndex":"asc"}],"unique":false}],"properties":{"transactionIndex":{"type":"integer","description":"Sequential index of asset unlock (withdrawal) transaction. Populated when a withdrawal pooled into withdrawal transaction","minimum":1,"position":0},"transactionSignHeight":{"type":"integer","description":"The Core height on which transaction was signed","minimum":1,"position":1},"amount":{"type":"integer","description":"The amount to be withdrawn","minimum":1000,"position":2},"coreFeePerByte":{"type":"integer","description":"This is the fee that you are willing to spend for this transaction in Duffs/Byte","minimum":1,"maximum":4294967295,"position":3},"pooling":{"type":"integer","description":"This indicated the level at which Platform should try to pool this transaction","enum":[0,1,2],"position":4},"outputScript":{"type":"array","byteArray":true,"minItems":23,"maxItems":25,"position":5},"status":{"type":"integer","enum":[0,1,2,3,4],"description":"0 - Pending, 1 - Signed, 2 - Broadcasted, 3 - Complete, 4 - Expired","position":6}},"additionalProperties":false,"required":["$createdAt","$updatedAt","amount","coreFeePerByte","pooling","outputScript","status"]}}},"$type":"withdrawal"}]
First timestamp for $createdAt: 1728505440651
Founded in second response: 0
Documents in second response: []

Possible Solution

Steps to Reproduce (for bugs)

  1. create new empty node project
  2. install dash-sdk package
  3. init client with withdrawal contractId in apps
  4. try to find documents by $createdAt

Context

Your Environment

  • Version used:
    • dash: 4.5.0
  • node: v20.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions