findAllMatches issue

Hi everyone.
I want to find some nodes in my scene with a specific tag value. ThomasEgi told me about findAllMatches, but I still have an issue.

What I want to do is something like that :

nodeCollection1 = render.findAllMatches("=type=database =sqlId=139 =incId=197")

but it returns no nodes. I tried this :

nodeCollection1 = render.findAllMatches("=type=database")
nodeCollection2 = nodeCollection1.findAllMatches("=sqlId=139")
nodeCollection3 = nodeCollection2.findAllMatches("=incId=197")

But nodeCollection3 is empty. It is not due to the fact that no object can be matched, for this tag values are taken from an object I picked on the scene.

Do you have an idea to help me ?

findAllMatches works by excluding the current node.
I just tried that and this works :

nodeCollection1 = render.findAllMatches("=type=database")
nodeCollection2 = nodeCollection1.findAllMatches("=sqlId=139" and "=incId=197")

Thanks a lot !

In fact, it does not work.

(string1 and string2) returns string2

It matches something, but not the right things.

Yeah, sorry.
Then you should check them 1 by 1 :

nodesList=[]
nodeCollection1 = render.findAllMatches("=type=database")
for n in nodeCollection1.findAllMatches("=sqlId=139").asList():
    if n.getTag("incId")=="197":
       nodesList.append(n)
print nodesList