Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to use mixed index in goblin? #95

Open
StanYaha opened this issue Jan 10, 2018 · 4 comments
Open

How to use mixed index in goblin? #95

StanYaha opened this issue Jan 10, 2018 · 4 comments

Comments

@StanYaha
Copy link

StanYaha commented Jan 10, 2018

Hi,Dave.
In gremlin shell, i use the composite index like this

g.V().has('id_number', 'xxx').toList()

I can use the goblin like

suspector = await session.traversal(Suspector).has('id_number', 'xxx').toList()

But how can i use the mixed index with goblin?
In gremlin shell

g.V().has('age', inside(18,30)).toList()

How can i use the goblin to make this?

@StanYaha StanYaha reopened this Jan 11, 2018
@davebshow
Copy link
Owner

Are you asking how to use inside?

from gremlin_python.process.traversal import inside

await session.g.V().has('age', inside(18,30)).toList()

@davebshow
Copy link
Owner

Did this solution work for you?

@StanYaha
Copy link
Author

StanYaha commented Feb 9, 2018

It's not worked!

async def go(loop):
    start = time.time()
    remote_connection = await DriverRemoteConnection.open('ws://localhost:8182/gremlin', 'g')
    g = Graph().traversal().withRemote(remote_connection)
    a = int(1516999699)
    b = int(1517492274)
    vertices =  await g.V().has('datetime',inside(a,b)).toList()

image

@StanYaha
Copy link
Author

StanYaha commented Feb 9, 2018

>>> from gremlin_python.process.traversal import inside
>>> from gremlin_python import statics
>>> from gremlin_python.structure.graph import Graph
>>> from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
>>> statics.load_statics(globals())
>>> graph = Graph()
>>> g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182','g'))
>>> g.V().has('datetime', inside(1516999699,1517492274)).toList()

This worked!But when i use the async and await,it failed

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants