suche 36x36
  • Admin-Scout-small-Banner
           

    CURSOR Admin-Scout

    get the ultimate tool for Informix

    pfeil  
Latest versionsfixlist
14.10.xC10 FixList
12.10.xC16.X5 FixList
11.70.xC9.XB FixList
11.50.xC9.X2 FixList
11.10.xC3.W5 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

Informix - Problem description

Problem IT21323 Status: Closed

CREATING INDEX ON ARRAY FIELD CAUSES SERVER TO RETURN BAD RESULTS USING
THE $IN PARAMETER

product:
INFORMIX SERVER / 5725A3900 / C10 - IDS 12.10
Problem description:
Collection creation:
use apimindex
db.createCollection("garage")
db.garage.insert({"cars":["A","B","C"]})
db.garage.insert({"cars":["B","C","D"]})
db.garage.insert({"cars":["C","D","E"]})
db.garage.insert({"cars":["F","G","B"]})

db.garage.ensureIndex({"cars":1})


Informix behavior does not return the correct results using the
$in:

> db.garage.find()
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("59553767ac1317d7bd258b94"), "cars" : [ "F",
"G", "B" ] }
> db.garage.find({"cars" : {$in:["A"]}})

> db.garage.find({"cars" : {$in:["A","B","C"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("59553767ac1317d7bd258b94"), "cars" : [ "F",
"G", "B" ] }
> db.garage.find({"cars" : {$in:["B","C"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("59553767ac1317d7bd258b94"), "cars" : [ "F",
"G", "B" ] }
> db.garage.find({"cars" : {$in:["C"]}})
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }


After dropping index I get the correct behavior with informix
> db.garage.dropIndex("cars_1")
{ "ok" : 1, "nIndexesWas" : 2 }
> db.garage.find({cars: {$in:["A"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
> db.garage.find({"cars" : {$in:["A","B","C"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("59553767ac1317d7bd258b94"), "cars" : [ "F",
"G", "B" ] }
> db.garage.find({"cars" : {$in:["B","C"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("59553767ac1317d7bd258b94"), "cars" : [ "F",
"G", "B" ] }
> db.garage.find({"cars" : {$in:["C"]}})
{ "_id" : ObjectId("59553741ac1317d7bd258b91"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("5955374eac1317d7bd258b92"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955375bac1317d7bd258b93"), "cars" : [ "C",
"D", "E" ] }



MongoDB behavior appears to be correct with or without the index
MongoDB Enterprise > db.garage.find()
{ "_id" : ObjectId("595552f65d33235f736b80d8"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("595552fe5d33235f736b80d9"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("595553065d33235f736b80da"), "cars" : [ "C",
"D", "E" ] }
{ "_id" : ObjectId("5955530e5d33235f736b80db"), "cars" : [ "F",
"G", "B" ] }
MongoDB Enterprise > db.garage.find({"cars" : {$in:["A"]}})
{ "_id" : ObjectId("595552f65d33235f736b80d8"), "cars" : [ "A",
"B", "C" ] }
MongoDB Enterprise > db.garage.find({"cars" :
{$in:["A","B","C"]}})
{ "_id" : ObjectId("595552f65d33235f736b80d8"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("595552fe5d33235f736b80d9"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955530e5d33235f736b80db"), "cars" : [ "F",
"G", "B" ] }
{ "_id" : ObjectId("595553065d33235f736b80da"), "cars" : [ "C",
"D", "E" ] }
MongoDB Enterprise > db.garage.find({"cars" : {$in:["B","C"]}})
{ "_id" : ObjectId("595552f65d33235f736b80d8"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("595552fe5d33235f736b80d9"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("5955530e5d33235f736b80db"), "cars" : [ "F",
"G", "B" ] }
{ "_id" : ObjectId("595553065d33235f736b80da"), "cars" : [ "C",
"D", "E" ] }
MongoDB Enterprise > db.garage.find({"cars" : {$in:["C"]}})
{ "_id" : ObjectId("595552f65d33235f736b80d8"), "cars" : [ "A",
"B", "C" ] }
{ "_id" : ObjectId("595552fe5d33235f736b80d9"), "cars" : [ "B",
"C", "D" ] }
{ "_id" : ObjectId("595553065d33235f736b80da"), "cars" : [ "C",
"D", "E" ] }
MongoDB Enterprise >
Problem Summary:
****************************************************************
* USERS AFFECTED:                                              *
* informix user with BSON ARRAY documents                      *
****************************************************************
* PROBLEM DESCRIPTION:                                         *
* See Error Description                                        *
****************************************************************
* RECOMMENDATION:                                              *
* Update to IBM Informix Server 12.10.xC10                     *
****************************************************************
Local Fix:
Solution
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
06.07.2017
01.11.2017
01.11.2017
Problem solved at the following versions (IBM BugInfos)
12.10.xC10
Problem solved according to the fixlist(s) of the following version(s)
Informix EditionsInformix Editions
Informix Editions
DocumentationDocumentation
Documentation
IBM NewsletterIBM Newsletter
IBM Newsletter
Current BugsCurrent Bugs
Current Bugs
Bug ResearchBug Research
Bug Research
Bug FixlistsBug Fixlists
Bug Fixlists
Release NotesRelease Notes
Release Notes
Machine NotesMachine Notes
Machine Notes
Release NewsRelease News
Release News
Product LifecycleProduct Lifecycle
Lifecycle
Media DownloadMedia Download
Media Download