 # TODO
 # Refactor the test functions
 
-state =
-    1:
-        test:
-            test:
-                data:
-                    "N1":
-                        id: 1
-                    "N2":
-                        id: 2
-                    "N3":
-                        id: 3
-    2:
-        test:
-            test:
-                data:
-                    "N1":
-                        id: 1
-                        key: 1
-                    "N2":
-                        id: 2
-                        key: 2
-                    "N3":
-                        id: 3
-                        key: 3
-                options:
-                    'primary_key': 'id'
-    3:
-        test:
-            test:
-                data:
-                    "N2":
-                        id: 2
-                        key: 3
-                    "N5":
-                        id: 5
-                        key: 3
-                    "N4":
-                        id: 4
-                        key: 1
-                    "N1":
-                        id: 1
-                        key: 1
-                    "N3":
-                        id: 3
-                        key: 2
+collection = [
+    [{id:1}, {id:2}, {id:3}],
+    [{id:1, key: 4}, {id:2, key: 5}, {id:3, key: 6}],
+    [{id:2, key: 3}, {id:5, key: 3}, {id:4, key: 1}, {id:1, key:1}, {id:3, key: 2}]
+]
 
 class Tests
     results: []

        query = @queries[@index]
        if query?
            console.log query.query
            cursor = eval(query.query)
            @callback()[query.callback_name](query.query, cursor, query.expected_result, @)

            ###
            @index++
            @test()
            ###

    display: (success, query, results) ->
        if success is true

                that.index++
                that.test()
                return false
        is_doc_1: (query, cursor, expected_result, that) =>
            @results = []
            cursor.next (data) =>
