metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (METAMODEL-183) For Mongo DB model, use new APIs instead of old ones.
Date Sun, 10 Jan 2016 16:04:39 GMT


ASF GitHub Bot commented on METAMODEL-183:

Github user xmpy commented on the pull request:
    @kaspersorensen  Thank you for your remarks  :)
    I do followings things in these 3 commits.
    1.  remove .classpath
    2.  make mongodb-common module work for both 2.x and 3.x
         Before this commit, we have a `public static Row toRow(Document document, DataSetHeader
header)` function in the MongoDBUtils in this common module. However, this `Document`, which
is the ` org.bson.Document` is only in the mongodb driver 3.x. So I do a little things to
remove functions which contain `Document` .
    I've added 'scoped' in pom. However, I think maybe there is some risk in it. For developer,
in the IDE such as Eclipse, Eclipse will still think we using mongodb 3.x, so developer maybe
write wrong functions which can not work in both mongodb 2.x and mongodb 3.x. 
    3.  move unclear function convertArrayToList to right place
    This function is used for converting array `[1,3,4]` to List. 
    Here is the problem code in the test 
        ds = dataContext.query().from(getCollectionName()).select("id").and("name").where("id").in(2,
6, 8, 9)
    In the `in` where condition, metamodel will convert `in` parameter to an array object
`[2,6,8,9]`. However, in the mongodb 3.x, the query Document class currently supports only
List, not support array, like in this bug

> For Mongo DB model, use new APIs instead of old ones.
> -----------------------------------------------------
>                 Key: METAMODEL-183
>                 URL:
>             Project: Apache MetaModel
>          Issue Type: Improvement
>            Reporter: Hosur Narahari
>            Priority: Minor
> I observed that we are using old APIs of MongoDB in our metamodel project, like Mongo
instead of MongoClient, DB instead of MongoDatabase and many more. It would be better if we
replace this with new API as support for Mongo driver would be for the new one.

This message was sent by Atlassian JIRA

View raw message