[
https://issues.apache.org/jira/browse/METAMODEL-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15091098#comment-15091098
]
ASF GitHub Bot commented on METAMODEL-183:
------------------------------------------
Github user xmpy commented on the pull request:
https://github.com/apache/metamodel/pull/86#issuecomment-170362357
@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
https://jira.mongodb.org/browse/JAVA-1894.
> For Mongo DB model, use new APIs instead of old ones.
> -----------------------------------------------------
>
> Key: METAMODEL-183
> URL: https://issues.apache.org/jira/browse/METAMODEL-183
> 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
(v6.3.4#6332)