-2

I am having vertices with label name as Campaign. And having a property campaignType and the property value is offline for all the vertices. I unexpectedly updated the schema with out building the index for campaignType. But I needed this very badly for traversing the online campaign.I have tried reindexing but I got an error.I have asked about it in stackoverflow as a new question but i didn't get ay response. So deleting the property is my second thought. So I want to delete that property from all the campaign vertices. I have tried

    g.V().hasLabel('Campaign').hasProperty('campaignType').remove()

but got an error

    Cannot invoke method remove() on null object

What I expect is all the vertices should present but only campaign type property should get deleted.I don't know what is wrong in my question but help me to get over it.

Himabindu
  • 634
  • 8
  • 22

1 Answers1

0

You can drop property by using properties and then drop

g.V().hasLabel('Campaign').properties('campaignType').drop()
noam621
  • 2,766
  • 1
  • 16
  • 26
  • Already tried this, but I am getting an error saying ``Could not find a suitable index to answer graph query and graph scans are disabled: [(~label = Campaign)]:VERTEX`` – Himabindu Feb 12 '20 at 10:49
  • That campaign type property is not having an index – Himabindu Feb 12 '20 at 10:50
  • 1
    By querying like this ``g.V().hasLabel('Campaign').has('active',true).properties('campaignType').drop()``, i have deleted the property values. But I want to delete the property value and also property key. – Himabindu Feb 12 '20 at 12:18
  • 3
    I suppose you could temporarily configure `query.force-index=false` to allow the query to execute. Assuming this is not a graph of massive size, the query in the answer should do what you want. – stephen mallette Feb 13 '20 at 11:46