Repository navigation
Closed
Labels
bugSomething isn't working
Description
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)
- create new empty node project
- install dash-sdk package
- init client with withdrawal contractId in apps
- try to find documents by
$createdAt
Context
Your Environment
- Version used:
- dash:
4.5.0
- dash:
- node:
v20.16.0
Reacted by Michael
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
[-]`where` in the search for documents does not work for some fields[/-][+]`where` in the getDocuments query does not work for $createdAt field[/+]QuantumExplorer commentedon Nov 9, 2024
@owl352 there is actually no issue here in the low level system, and more likely an issue in the JS-SDK, because there is no index on $createdAt, and hence it will try to find the next best index to use. Which in this case would be
owl352 commentedon Nov 10, 2024
@QuantumExplorer Thank you! I figured it out, now '==' works, but now I don't really understand how to search with non-strict equals, because in this case we need to use orderBy, and according to the documentation it accepts only 2 fields.
riongull commentedon Nov 10, 2024
What was the issue @owl352?
Something simple like making
1728505440651a string, something trickier that needs better documentation?owl352 commentedon Nov 10, 2024
@riongull
More like something simple. I only had a search on
$createdAtand the index contains 2 other fields, but explaining this point didn't help me. At the moment I can find a document by$createdAtwith strict equality for$createdAt,status,$ownerId, however I have a use case where status is unknown and the logical solution is to use['status', '>=', 0], however in that case I have to useorderBywhich only accepts 2 fields and with any combination of these fields I get either an error or an empty arrayowl352 commentedon Nov 10, 2024
working:
not working (also with orderBy):
owl352 commentedon Nov 11, 2024
I also found an error in the documentation
https://docs.dash.org/projects/platform/en/stable/docs/sdk-js/platform/documents/get.html
startAtandstartAftershould be identifiers, not integersdocs: fix startAt and startAfter types
owl352 commentedon Nov 16, 2024
@QuantumExplorer



Faced a problem with installing startAfter. I think I did everything correctly. In the end I get an empty array if I specify where and startAfter
QuantumExplorer commentedon Nov 20, 2024
Interesting, let me think about the problem.
QuantumExplorer commentedon Nov 21, 2024
@owl352 excellent find, in this case the index chosen is the closest index:
{ "name": "identityRecent", "properties": [ { "$ownerId": "asc" }, { "$updatedAt": "asc" }, { "status": "asc" } ], "unique": false },There's a problem with the path query that we generate from the query where we take all fields and do a >, except that it should be only the top field. If that didn't make sense don't worry. I'll fix it soon.
QuantumExplorer commentedon Nov 25, 2024
This has been fixed, will be in 1.6 @owl352 . Thanks again for finding it.