<div dir="ltr">Hi Henning,<div><br></div><div>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.</div><div><br></div><div>ERROR: db_mongodb [mongodb_dbase.c:452]: db_mongodb_get_columns(): field ["Location":"Prefix"] not found in result iterator<br><br>ERROR: db_mongodb [mongodb_dbase.c:452]: db_mongodb_get_columns(): field [Location:Prefix] not found in result iterator<br></div><div><br></div><div>Regards,</div><div>--Sergiu</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 2, 2021 at 12:11 PM Henning Westerholt <<a href="mailto:hw@skalatan.de">hw@skalatan.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="DE" style="overflow-wrap: break-word;">
<div class="gmail-m_3571473018508438776WordSection1">
<p class="MsoNormal"><span>Hi Sergiu,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">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).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">What are the error messages that you get, maybe there are some hints in it?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://gilawa.com</span></a></span><span>
<span lang="EN-GB"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Sergiu Pojoga<br>
<b>Sent:</b> Tuesday, March 2, 2021 4:39 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> [SR-Users] Load htable from MongoDB<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Hi there,<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">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?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">For example:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">modparam("htable", "htable", "users=>size=10;dbtable=users;cols='FirstName,LastName,Location:Prefix';")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Fails when trying to load the value of Location.Prefix<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">{<br>
"FirstName": "John",<br>
"LastName": "Doe",<br>
"Language" : "en",<br>
"Location" : {<br>
"Country" : "USA",<br>
"City" : "New York",<br>
"Prefix" : "+1"<br>
}<br>
}<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Thanks in advance.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote></div>