Hi, all.. I am working on a Teapot REST interface, and am getting ready to implement the create, read, and update methods for the objects, and I need a way to refer to the objects. I figured that since Voyage was already creating _id through MongoDB, I could just pass that on when I retrieved that object, but I don’t see how to do that. Is this possible? Would I need to create my own numerical indexes to my objects and just retrieve them as part of the object query? Thanks! ---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.Village-Buzz.com http://www.ThoseOptimizeGuys.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 signature.asc (852 bytes) Download Attachment |
You can ask every voyage object for its id. Just do anObject voyageId you get an OID object which you can ask for its #value to get the numeric id. Norbert
|
Perfect! this is what i needed.. i don’t want to manage two sets of IDs.. Thanks! On February 1, 2017 at 9:37:43 AM, Norbert Hartl ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.Village-Buzz.com http://www.ThoseOptimizeGuys.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 signature.asc (852 bytes) Download Attachment |
In reply to this post by NorbertHartl
hmmm.. can you query for an object with that voyageId? On February 1, 2017 at 9:37:43 AM, Norbert Hartl ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.Village-Buzz.com http://www.ThoseOptimizeGuys.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 signature.asc (852 bytes) Download Attachment |
MyClass selectOne: { '_id' -> (OID value: 16r<hex value>) } asDictionary Norbert
|
Got it.. Smalltalk is one language where it ALWAYS seems that there is a more clever way to do anything than the way i am doing it.. I’ll try this.. Thanks! On February 1, 2017 at 10:43:36 AM, Norbert Hartl ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.Village-Buzz.com http://www.ThoseOptimizeGuys.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 signature.asc (852 bytes) Download Attachment |
Norbert
|
Yes.. smalltalk doesn’t impose a whole lot of style limitations on the developer, and most of the code i run into is very high quality.. so, using all the available code, you’re really just learning good practices from a bunch of smart people… the language is really inconsequential.. On February 1, 2017 at 11:29:12 AM, Norbert Hartl ([hidden email]) wrote:
---- peace, sergio photographer, journalist, visionary Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.Village-Buzz.com http://www.ThoseOptimizeGuys.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101 signature.asc (852 bytes) Download Attachment |
Free forum by Nabble | Edit this page |