Questions tagged [objectid]

The ID of an object. This is used, among other reasons, to refer back to the object at a later time in the program

Used especially in web programming where space on the stack is limited, objectids are used to refer to objects at different parts of the program, and possibly even across different user sessions, if some marshalling is implemented (as databases, etc).

The ID of an object can also be used to determine if two objects are distinct instances or are indeed the same object, in which case, any modifications made on one would be reflected in the other as well

481 questions
0
votes
1 answer

error C3481: 'Out': lambda capture variable not found while calling ObjectIDGenerator.GetID in C++/CLI

I need to pass a boolean value in the ObjectIDGenerator.GetID(Object^,out bool) in C++/CLI. Having a similar problem as described here. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/2ec8e666-ecac-491e-bfb1-1b9108f7eb92 Searched…
0
votes
2 answers

How can I cast integer PK s from legacy MySQL database int MongoDB's ObjectID?

I want to migrate from MySQL to MongoDB. In MySQL, PKs are integer. I want to cast them into ObjectID When I try: mongo.ObjectID(theInteger) altough theInteger is same, results are different. How can I do that?
Burak
  • 5,706
  • 20
  • 70
  • 110
0
votes
2 answers

Using one method in place of many

I am trying to learn Objective-C for iOS. I have tried researching this, but I must not be using the right keywords. I have several labels that are simply named, Label1, Label2, etc. I also have a ton of code that basically looks the same except…
tcison
  • 13
  • 1
  • 5
0
votes
1 answer

Why Ruby Instance Variables object_id s are weird

Below is the test case, I was just trying to do something with dup method. But I realized this weird behavior. I couldn't find any reasonable explanation. class ObjectIdTest attr_accessor :x, :y def initialize @x, @y = 1, 2 end def…
tackleberry
  • 1,003
  • 2
  • 12
  • 16
0
votes
1 answer

Play2 - form -> objectId

I have a problem with the forms in play2. Model: @Id private ObjectId id; Form I can not initialize the id field with bindFromRequest() it will always be empty. And I…
Maik Klein
  • 15,548
  • 27
  • 101
  • 197
-1
votes
1 answer

What is the size in bytes of the string return from ObjectId.toString()

const myObjectId = ObjectId("507c7f79bcf86cd7994f6c0e") const myObjectIdString = myObjectId.toString() myObjectId has a size of 12 bytes. But what about the size of myObjectIdString?
-1
votes
2 answers

OBJECT_ID() works for all objects BUT views?

Here I want to retrieve OBJECT_ID of a view as I do with my other objects. But am facing the fact that it returns NULL instead SELECT TOP 1 1 FROM sys.views WHERE object_id = OBJECT_ID('vw202004-divvy-tripdata.csv') /* Result: NULL */ Here is…
Xanadu
  • 11
  • 2
-1
votes
1 answer

AssertionError [ERR_ASSERTION]: you must pass Joi as an argument

How do I solve this Joi problem(Using express, joi@17.4.2,joi-objectid@2.0.0, ,mongoose) I am trying to link two mongoose schemas using ref as { ... enroledcourses: [{ type: Schema.Types.ObjectId, ref: "courses" }] } joi…
-1
votes
3 answers

How to remove new ObjectId() from the display of JSON data?

How do I remove the new ObjectId() from my output when displaying JSON data? Below is my code to get the data using the id from mongodb: async get(id) { if (!id) throw 'You must provide an id to search for'; const restaurantsCollection =…
Swayam Shah
  • 200
  • 1
  • 12
-1
votes
1 answer

typescript Argument passed in must be a single String of 12 bytes or a string of 24 hex characters

I´m using typescript on node js to extracta data from Excel and save it on mongodb, there is however a field that has an id hardcoded, but when I try to save it as an ObjectId, I get the error: Argument passed in must be a single String of 12 bytes…
Jhon Hernández
  • 293
  • 5
  • 20
-1
votes
1 answer

Object ID conflict in extensions in AL (Business Central OnPremises)

I'm a beginner in Dynamics Nav/Dynamics365/Business Central developing extensions in AL and I'm having a problem that I don't know how to solve it 'easily'. I am working with 2 projects in Visual Studio Code at the same time in one workspace…
-1
votes
1 answer

Generate a unique ObjectId for a collection

I would like to generate a unique ObjectId for a resource to give back clients with the nodejs mongodb driver. IE: var ObjectID = require('mongodb').ObjectID; var objectId = new ObjectID(); Reading about an ObjectId it seems that there are some…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
-1
votes
2 answers

How do I reduce guessability of MongoDB ObjectIDs?

MongoDB ObjectIDs are guessable. I'm running an application that has publicly available resources located at http://application.com/resource/**ObjectID** These resources need to be publicly accessible (not behind a login), however I'm trying to…
winduptoy
  • 5,366
  • 11
  • 49
  • 67
-1
votes
1 answer

How to convert json objectId to its string representaion in javascript

I would like to convert json representation of bson ObjectId returned from REST mongodb API to string from: {"inc":1365419770,"machine":-856505582,"timeSecond":1375343587,"time":1375343587000,"new":false}; to: 51fa13e3ccf2c3125162a6fa in the client…
moshe beeri
  • 2,007
  • 1
  • 17
  • 25
-2
votes
1 answer

How to construct an ObjectId from a negative time value

const { ObjectId } = require("mongodb"); > new Date(-1) 1969-12-31T23:59:59.999Z > ObjectId(-1) Uncaught: RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received -1 Why is the possible input…
1 2 3
32
33