[SR-Users] Load htable from MongoDB

Sergiu Pojoga pojogas at gmail.com
Tue Mar 2 18:25:26 CET 2021


Hi Henning,

Well, it works fine if the document is a "flat JSON" without arrays and
other sub-objects in it. I tried with and without escaping quotation marks,
but no luck.

ERROR: db_mongodb [mongodb_dbase.c:452]: db_mongodb_get_columns(): field
["Location":"Prefix"] not found in result iterator

ERROR: db_mongodb [mongodb_dbase.c:452]: db_mongodb_get_columns(): field
[Location:Prefix] not found in result iterator

Regards,
--Sergiu

On Tue, Mar 2, 2021 at 12:11 PM Henning Westerholt <hw at skalatan.de> wrote:

> Hi Sergiu,
>
>
>
> I did not try it by myself so far, maybe others can comment on it.
> Normally you should be able to use the htable module on all usual database
> modules (that offer the needed capabilities).
>
> What are the error messages that you get, maybe there are some hints in it?
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-users <sr-users-bounces at lists.kamailio.org> *On Behalf Of *Sergiu
> Pojoga
> *Sent:* Tuesday, March 2, 2021 4:39 PM
> *To:* Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
> *Subject:* [SR-Users] Load htable from MongoDB
>
>
>
> Hi there,
>
>
>
> Question: is it possible to load a htable, defined by columns, from a
> MongoDB collection, when a certain "column" is an object with multiple
> elements?
>
>
>
> For example:
>
> modparam("htable", "htable",
> "users=>size=10;dbtable=users;cols='FirstName,LastName,Location:Prefix';")
>
>
>
> Fails when trying to load the value of Location.Prefix
>
>
>
> {
>     "FirstName": "John",
>     "LastName": "Doe",
>     "Language" : "en",
>     "Location" : {
>         "Country" : "USA",
>         "City" : "New York",
>         "Prefix" : "+1"
>     }
> }
>
>
>
> Thanks in advance.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210302/c2e3c0d0/attachment.htm>


More information about the sr-users mailing list