1

I am validating Apache MetaModel as a storage abstraction layer and experienced problem with primary key lookup in MongoDB.

As we know every document in mongo has unique _id column with ROWID type, and using metamodel I can't even to run query "select by id"

This query return no data, but I am 100% sure document with this id in collection:

DataSet ds = dc.query()
            .from("users")
            .selectAll()
            .where("_id").eq("56334c6fb38cfec169db2ccb")
            .execute();

Using 'id' as a pkey throws obvious "Could not find column: id"

DataSet ds = dc.query()
            .from("users")
            .selectAll()
            .where("id").eq("56334c6fb38cfec169db2ccb")
            .execute();

Filtering on other columns works fine. I have a gut feeling I am doing something wrong, could someone advise suggestions?

mishadoff
  • 10,719
  • 2
  • 33
  • 55

1 Answers1

1

It is a bug. I have reported an issue in MetaModel's JIRA: https://issues.apache.org/jira/browse/METAMODEL-211

TomaszGuzialek
  • 861
  • 1
  • 8
  • 15
  • Thanks, I'll try to fix it locally for now. But what do you think we can get a released public version for MetaModel with fix, assuming we have the fix? – mishadoff Nov 25 '15 at 10:02
  • I cannot promise an immediate release, but Apache MetaModel is released regularly, so after merging a pull request, the fix will be soon publicly available. – TomaszGuzialek Nov 25 '15 at 18:06