Add to Linklist not working - orientdb

I have a linklist called 'Users' one of my table in orient db database.
I want add new item to Users.
When i execute following query it return with empty results with no error.
update #24:20 ADD Users = #12:1
Please advice me to add a new item to linklist.
Thanks in advance

I have installed version 2.2.1.3 . It works fine with new version. But query has changed to follows.
update #24:20 SET Users = #12:1
thanks for the comments...

Related

Creating a rule in postgresql to automatically add a json on INSERT

I'm creating a discord member db in PostgreSQL but I'm still a beginner.
And I'm trying, as specified in the title, to create a rule that, when I add a new member to the db, adds a json to that member's column.
Here's the code I got so far and it's not working:
CREATE OR REPLACE RULE tank_json AS
ON INSERT TO public.members
DO (UPDATE members
SET tank={"own_tank"=0, "engine"=0, "wheels"=0, "cannon"=0}
WHERE NEW.name);
I think that the problem might be on the last part "WHERE NEW.name" but I'm not sure how else I'm supposed to specify where it should add that json without messing with the other member's data.
Thanks in advance.

Talend- get results from tdb2Row component and insert into another table

I'm running a select count query in a tDB2Row component. I need to get the value found and insert it into another table.
I've tried using the propagate query's recordset, but it doesn't make sense to me.
Also what component would i use next?
Thanks in advance!
Please use tDB2Input component for select query and give schema to it and add tLogRow to it to see the result.
tDB2Row is for dml query like update and delete.
Hope this helps...

How do I resolve error with insert() with Mongo BasicDBObject

Hope this isn't too newBish of a question, but I created a collection of client users (as usersCollection), then I create a user like:
BasicDBObject user = new BasicDBObject("_id", username);
I append a couple more bits to it depending if I have them from the form that the user enters.
But then when I try to insert the user in the usersCollection...
usersCollection.insert(user);
My IDE complains that it cannot resolve method insert(com.mongodb.BasicDBObject)
I don't see the problem... I am using mongodb-driver 3.2.2... if that's even relevant.
Any clue what I doing wrong?
Make sure your usersCollection object class is com.mongodb.DBCollection . From the present information I can only deduce that it's of another type as it does not recognize the insert method.
I changed directions... instead of using a DBObject I instantiated the collection as a document
MongoCollection<Document>
Next I created the user like:
Document user = new Document("_id", username);
(and appended some other bits after that)
Finally, to insert it, simply insertOne()
allUsers.insertOne(user);
Really not sure what I was doing wrong with DBObject but I do think I was making it more complicated than it needed to be. Thanks for the tips though, your questions helped push me to rethink why I was doing it that way to begin with.

How to run the update query in JPA

I am playframework application developer. I am using createNativeQuery method in jpa to extracting values from tables through select query. I need to use update query. What i have to do and what will be the return type of that method. Please anyone help me. Thanks in advance..
if i use like this it showing error..
Query query=JPA.em().createNativeQuery("update truck set flag='YES' where shipment_upc=:EAN_code");
query.setParameter("EAN_code", EAN_code);
System.out.println(query.getSingleResult());
Use createNativeQuery with your update- query and you will get back a Query- Object.
On it use executeUpdate and you get back the number of updated datas.

Unable to delete the existing document in lucene index

I am using Lucene.Net (version 2.9.4.1) to implement a simple search module. I'm trying to delete the document if it exists in the index using the following code,
var analyzer = new StandardAnalyzer(Version.LUCENE_29);
var indexWriter = new IndexWriter(
LuceneSearch._luceneDir,
analyzer,
IndexWriter.MaxFieldLength.UNLIMITED);
var searchQuery = new TermQuery(new Term("ListID", listingDoc.Get("ListID")));
indexWriter.DeleteDocuments(searchQuery);
where listingDoc is of type Document i'm trying to delete the document if it exists and then add it again to the index, the adding part works fine but the deleting part is not working that is the document is not deleted if it exists. Therefore if i search a term and it matches it is shown multiple times... Please point out what iam doing wrong here
I am using ASP.Net MVC3 and Entity Framework4. every time a record is updated i intend to update the index but instead its been duplicated. and when i search it i get the result twice or thrice depending upon the number of times i do the update.
I tried using indexWriter.UpdateDocument(args); to no avail...
When debugging deletions it can sometimes be useful to perform a search with the same parameters as the delete command, to see exactly what is going to get deleted.
If you're doing a deleteDocuments(query) you should use an IndexSearcher like this:
IndexSearcher is = new IndexSearcher(indexWriter.GetReader());
TopDocs topDocs = is.Search(query, 100);
And see what you get in the topDocs. I suspect you'll find that the query doesn't return any results.
You can do it by simply:
Query query = queryParser.parse("My Query!");
writer.deleteDocuments(query);