Is dgraph fit for time series and finding equal value in array

mutation

(jihantoro) #1

is DGraph database fit for this task :

  1. select by unix/epoch time, lower/upper (> or <) than given time (timeseries)
  2. database that support array, and find word/sentence inside the array

query example :

select * from tweet where created_at > start_at and created_at < end_at and keyword in arraycolumn

(Michel Conrado) #2
{
  q(func: has(tweet))@filter(gt(created_at, "2018") 
    AND lt(created_at, "2019") 
    AND eq(arraycolumn, "keyword")){
    expand(_all_)
  }
}

OR

{
  q(func: eq(arraycolumn, "keyword") )@filter(gt(created_at, "2018") 
    AND lt(created_at, "2019")  {
    expand(_all_)
  }
}

Where this “start_at” come from? and what is this “keyword” exactly?

yep

yep


(Dmitry Russ) #3

For information: This query could be slow without BTree index if there are many tweets all over the time and only time span makes result span smaller.