Skip to content

Query 2 - (Regular Expressions Support) #4

@fvonschrenk

Description

@fvonschrenk

regex runs don't use /xxx/

db.num.find();
{ "_id" : ObjectId("4e8ef812a3963e830a27360a"), "value" : 1 }
{ "_id" : ObjectId("4e8ef818a3963e830a27360b"), "value" : 2 }
{ "_id" : ObjectId("4e8ef81ba3963e830a27360c"), "value" : 3 }
{ "_id" : ObjectId("4e8ef81fa3963e830a27360d"), "value" : 4 }
{ "_id" : ObjectId("4e8ef825a3963e830a27360e"), "value" : 5 }
{ "_id" : ObjectId("4e8ef82ba3963e830a27360f"), "value" : 6 }
{ "_id" : ObjectId("4e8ef82ea3963e830a273610"), "value" : 7 }
{ "_id" : ObjectId("4e8ef831a3963e830a273611"), "value" : 8 }
{ "_id" : ObjectId("4e8f5674a3963e830a273616"), "value" : 9, "value1" : 9, "value2" : "Frank" }

    private function reg(cursor:Cursor):void{
        if (cursor.toArray().length==2){
            dispatch(new TestEvent(TestEvent.PASS,"pass   $or"));
        }else{
            dispatch(new TestEvent(TestEvent.FAULT,"fault  $or"));
        }

        var docOut:Document = new Document(); 
        var docIn:Document = new Document(); 

        docOut.put("$regex", "ra");
        docIn.put("value2",docOut);

        dm.db.collection("num").find(docIn).add(enda);
    }

    private function enda(cursor:Cursor):void{
        if (cursor.toArray().length==1){
            dispatch(new TestEvent(TestEvent.PASS,"pass   $regex"));
        }else{
            dispatch(new TestEvent(TestEvent.FAULT,"fault  $regex"));
        }
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions