-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationtriageissue to be triageissue to be triage
Description
Describe the bug
I'm just creating documents and want to return them ordered by most recent first (descending by StartTime)
Here's the simple schema for the document:
{
"@documentation": {
"@comment": "Base memory",
"@properties": {
"Data": "The data representing the memory (only text right now)",
"EndTime": "End time of memory",
"StartTime": "Start time of memory"
}
},
"@id": "Memory",
"@key": { "@type": "Random" },
"@type": "Class",
"Data": "xsd:string",
"EndTime": "xsd:dateTime",
"StartTime": "xsd:dateTime"
}
The below query returns nothing (bindings is zero length array)
let qry = Q.triple("v:Memory", "type", "Memory").triple(
"v:Memory",
"Data",
"v:Data"
);
db.query(qry).then((response) => { yadda yadda}I know documents are in there because i can get them with
db.getDocument({
graph_type: "instance",
as_list: true,
type: "Memory",
count: 20,
})The following was an attempt at orderying by StartTime, which also returns an emtpy binding array
let [StartTime] = Q.vars("StartTime");
let qry = Q.order_by([StartTime, "asc"])
.triple("v:Doc", "type", "Memory")
.triple("v:Doc", "Data", "v:Message")
.triple("v:Doc", "StartTime", StartTime);
db.query(qry)What's the proper syntax to get these documents returned ordered by newest first? (based on StartTime field)
Issue originally posted by community member Harman on discord
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationImprovements or additions to documentationImprovements or additions to documentationtriageissue to be triageissue to be triage