Search Postgresql Archives

Nested fields with Mongo FDW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I recently installed a PostgreSQL server to this spec:

server v9.3.6
EnterpriseDB mongo_fdw vREL-4_0_0
libbson v1.1.5
mongo C driver v1.1.5

and Mongo is at 2.7.1. Mapping fields in Mongo documents, including _id, has been successful, with the exception of nested fields. Assuming my Mongo document looks like this:

{
    "_id" : ObjectId("5550ebf18cf0280b5fec373a"),
    "message": {
        "order_id": 15
    }
}

I would think this table should do:

CREATE FOREIGN TABLE ats.messages (
    _id NAME,
    "message.order_id" INT
)
SERVER mongo_server OPTIONS (database 'db', collection 'test_collection')

While that doesn't raise any errors, any SELECT against the table shows "message.order_id" as empty. Are nested fields supported in this version of mongo_fdw? If so, what's the proper way to map nested fields to table columns?

thank you,
MC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux