Hi!
To get the exact number you still have to count nodes/relationships.
getNumberOfIdsInUse includes Id slots waiting to get reused. So the
number you get may be higher than the actual number of
nodes/relationships in the database.
/anders
2011-03-22 23:12, Pablo Pareja skrev:
> Hi Matěj,
>
> Regarding the number of nodes/edges in the database you can use the
> following lines
> of code in case you haven't deleted any (because of id re-use):
>
> *l*ong number = ((EmbeddedGraphDatabase)
> graphDatabaseService).getConfig().getGraphDbModule().getNodeManager().getNumberOfIdsInUse(Node.class);
> System.out.println("nodes number = " + number);
>
> number =
> ((EmbeddedGraphDatabase)
> graphDatabaseService).getConfig().getGraphDbModule().getNodeManager().getNumberOfIdsInUse(Relationship.class);
> System.out.println("relationships number = " + number);
>
> Cheers,
>
> Pablo
>
> On Tue, Mar 22, 2011 at 10:57 PM, Matěj Plch<[email protected]> wrote:
>
>> Hi!
>> Do you have any experience how to store changing attributes of node?
>> It's like to build a table of changes for each changed node attribute.
>> In SQL datastore quite simple, but in no-SQL?
>> And one more question. Is it possible with some easy call though Java
>> API how to get number of nodes and edges stored in the database? Or I
>> have to traversal all graph?
>> Thank you
>> Matej Plch
>> _______________________________________________
>> Neo4j mailing list
>> [email protected]
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user