I have a 2 "WEEK" vertices on azure cosmosdb graph.
g.V().hasLabel('WEEK').valueMap()
output:
{
"type":["1 week|1 month|1 wk|one month|one week|one wk"]
},
{
"type":["11 weeks|11 months|11 wks|eleven months|eleven weeks|eleven wks"]
}
i am trying to search CONTAINS of a STRING in the "type" property and return the vertices.
STRING = "1 week"
g.V().hasLabel('WEEK').has('type',TextP.containing('1 week')).valueMap()
output:
{
"type":["1 week|1 month|1 wk|one month|one week|one wk"]
},
{
"type":["11 weeks|11 months|11 wks|eleven months|eleven weeks|eleven wks"]
}
i am getting all the vertices because "11 weeks|11 months|11 wks|eleven months|eleven weeks|eleven wks" also have '1 week' in it.
my requirement is that i have to search for the contains operation but only 1st vertex should be present not the second one.
one idea can be changing the data in the "type" property and change the search string as below
g.V().hasLabel('WEEK').valueMap()
output:
{
"type":["(1 week)|(1 month)|(1 wk)|(one month)|(one week)|(one wk)"]
},
{
"type":["(11 weeks)|(11 months)|(11 wks)|(eleven months)|(eleven weeks)|(eleven wks)"]
}
STRING = "(1 week)"
g.V().hasLabel('WEEK').has('type',TextP.containing('(1 week)')).valueMap()
output:
{
"type":["(1 week)|(1 month)|(1 wk)|(one month)|(one week)|(one wk)"]
}
but this way we need to change the entire data in the "type" property and have to change the STRING as well from "1 week" to "(1 week)" (as "1 week" is received from upstream)
Please let me know any other ideas for the above scenario (doing contains is mandatory)
Thanks in advance.