I've got a problem with MongoDB. When I make something like :   User.find({}, (err, result) =&gt; { })   I get something like :  [{ _id: someId name: someName surname: someSurname }]   When I copy it to clipboard and paste to any variable like :  let a = [{ "_id": "someId" "name": "someName" "surname": "someSurname" }]   And I check if ( a === result ), I get false and its not the same. My question is why, and how to fix it cause I need change "result" to something like "a"
11800
A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.
32595
I need to set a constant value as true or false for the particular scenario not sure correct working or not const test = data.findIndex(d =&gt; d.Fname === '' &amp;&amp; d.Lname === '') &lt; 0 ? false : true;  if fname and Lname both are blank then i want to set test as false not sure what is happening here.
26228
What is the difference between == and === in php. I am unsure when to use both.  Updated note: So that it shows up in StackOverflow search, the difference between == and === is the same as the difference between != and !==.
102926
Searching for " should return a list of questions that have the tag [comments] but not the tag [feature-request]. The right hand sidebar says that, but the search results are identical to .    As random points out, the operator works, but seems to be broken if a minus sign is the first tag in the resulting search URL. This is a problem because the system re-orders the tags when you put them into the search box, always putting the one with the minus sign first.    Edit: Here's another behaviour that I haven't encountered until now. I was trying to pattern search for tags that contain 'array' but NOT include '-array', so I did the search . The resulting page shows the right tags with the right operators on them, but the results aren't being filtered properly (the first result includes [multidimensional-array]). So I simplified and  (1,960 results), and then  (1,963 results -- what??), which still included that first question with [multidimensional-array] on it. Something is not working right here.
107813
I'm looking at the following code snippet:  my @ret = &lt;someMethod&gt; return (undef) if( $DB_ERROR ); return (undef) unless ($#ret &gt;= 0);   Does $# just give you a count of elements in a array?
80168
I have a database file from MongoDB 2.4 and we want use this on mongodb 3.6.  note: the file is original from the db path. Not from mongodump. This process is messy as it requires doing so on many of our clients.  Any advice will be welcomed as I'm a bit lost in this process.  Thanks
82914
I have some dynamic SOQL code in which I'd like to identify whether a method argument is a collection or a single value:  SObject[] query(SObjectType sobType, String field, Object data) {     // Want to know if data is a collection e.g. set or list     // that requires an "in" or a single value that requires     // an "=" in the query. (May also need to use separate bind variables.) }   I note that the sort of check shown immediately below seems to require an exact match for the type of the collection (Id in this case to return true) which is not what I want:  Object o = new Set&lt;Id&gt;(); System.debug(o instanceof Set&lt;Id&gt;);   Is there a simple way to make this determination?  (Yes there are various other ways to code this; checking first to see if there is a direct solution.)  PS  Looks like great caution is needed when using .
109143
name=Jackson echo $name   This will display Jackson.  name="Jackson" echo $name   This will also display Jackson.   So I assume by putting quotation marks around a variable it is making it a string. What would name=Jackson technically be? Would it also be recognized as a string?
25759
I have encountered comparisions of variables to string literals multiple times over the years which had one character prefixing the variable and the literal, e.g.  if [ "x$A" = "xtrue" ]; then   in order to check whether $A is "true".  I assume this is done to achieve shell compatibility or to work around a longterm bug, an unintuitive behavior, etc. Nothing obvious comes to mind.  Today I figured I want to know the reason, but my research didn't turn up anything. Or maybe it's just me making something out of a rather frequent exposure to rare occurances.  Is this practice still useful, maybe even best?
70996
I am continuously getting the following error:     Missing '}' or object member name.   Does anyone see what it is referring to? I am not missing the ending }.      {         "@context": "http://schema.org",         "@type": "ProfessionalService",         "additionalType": "http://www.productontology.org/id/Web_design",         "name": "site",         "url": "example.com",         "logo": "example.png",         "description": "Company",         "telephone": "555 555 5555",         "areaServed": ["Canton", "Akron", "Fairlawn", " Medina", "Hudson", "Green", "Cleveland", "Massillon", "Independence", "Stow", "North Canton", "Baberton"],     }
77169
Sometimes I see a command like  find . -name * -exec ls -a {} \;   I was asked to execute this.  What does {} \; mean here?
97939
Can someone tell me what is wrong with this loop?    The error that I have is on the line 107 (first line of the loop). It says:      [V2016057174800: command not found.    I am trying to associate two the same filename from two different documents (if that makes sense).
4495
How do I check if an object has a specific property in JavaScript?  Consider:  x = {'key': 1}; if ( x.hasOwnProperty('key') ) {     //Do this }   Is that the best way to do it?
99911
I wrote the following trigger and I'm getting the error :     Illegal assignment from Schema.SObjectField to String   But I don't know how to fix it. I wrote a similar trigger before and didn't have any issues.   trigger AccountDuplicates on Account (before insert, before update) {  for (Account myaccount : Trigger.new) {         List &lt;Account&gt; dupes = [SELECT Name FROM Account WHERE Name = :(myaccount.Name)];          if (dupes.size() &gt; 0) {            myaccount.Duplicate_Account__c = Account.name;         }     } }   The purpose of the trigger - when a new account is created that matches the name of an existing account, put the existing account's name into the "Duplicate Account" field.
79438
Can anyone explain how the LIKE operator is implemented in current database systems (e.g. MySQL or Postgres)? or point me to some references that explain it?  The naive approach would be to inspect each record, executing a regular expression or partial string match on the field of interest, but I have a feeling (hope) that these systems do something smarter.
67234
Below is the code tried,  @wire(getObjectDetails)     wiredResult(data,error) {          if(data){             console.log('DateOfRun--&gt;',data);             this.lstRecs=data;             console.log('values len--&gt;',this.lstRecs);             console.log('values --&gt;',this.lstRecs.values);         } else if(error){             console.log('error --&gt;'+error);            }     }    I am getting data as [object Object],But would like to fetch the values of a record.  i tried below:   @wire(getObjectDetails)     wiredResult(data,error) {          if(data){             console.log('DateOfRun--&gt;',data);//[object object]             this.lstRecs=data;             console.log('values len--&gt;',JSON.stringify(data));//Getting json value             this.strtest=JSON.stringify(data);             console.log('data=='+this.strtest.data);//undefined          } else if(error){             console.log('error --&gt;'+error);            }     }
45767
I am seeing different results from the find command between being run manually on the command line vs run in a script.   If I run the following on the command line:   find . -name '*.txt' ! -name '*20120427.txt'    I get all the .txt files in a directory except for the ones with the date that I want to avoid.  But when I have this same line in a script with a variable to identify the date:  FDATE=`date +%Y%m%d` find . -name '*.txt' ! -name '*${FDATE}.txt'    The script finds all the .txt files including the ones with the date I want to avoid.   The only difference between the 2 is that I am passing the FDATE variable in the script. Is there something obvious I am missing? I do not understand why the results are coming out different.